From 71ae7601160aca672f2b13a461aab6e4aee7f9d0 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Thu, 30 Jan 2014 11:30:16 -0800 Subject: [PATCH] Force explicit remove of files instead of defer The checkout code used to defer removal of "blocking" files in checkouts until the blocked item was actually being written (since we have already checked that the removing the block is acceptable according to the update rules). Unfortunately, this resulted in an intermediate index state where both the blocking and new items were in the index which is no longer allowed. Now we just remove the blocking item in the first pass so it never needs to coexist. In cases where there are typechanges, this could result in a bit more churn of removing and recreating intermediate directories, but I'm going to assume that is an unusual case and the churn will not be too costly. --- src/checkout.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/checkout.c b/src/checkout.c index f11ab8d46..5b1f6cdcc 100644 --- a/src/checkout.c +++ b/src/checkout.c @@ -246,6 +246,8 @@ static int checkout_action_no_wd( *action = CHECKOUT_ACTION_IF(SAFE, UPDATE_BLOB, NONE); break; case GIT_DELTA_DELETED: /* case 8 or 25 */ + *action = CHECKOUT_ACTION__REMOVE; + break; default: /* impossible */ break; }