From: Thomas Rast
Date: Fri, 29 Nov 2013 19:07:02 GMT
Subject: Re: [PATCH/WIP] Repair DF conflicts during fetch.
Message-ID: <871u1zf2nd.fsf@thomasrast.ch>
In-Reply-To: <1385747858-29343-2-git-send-email-jackerran@gmail.com>
Tom Miller writes:
> When a DF conflict occurs during a fetch, --prune should be able to fix
> it. When fetching with --prune, the fetching process happens before
> pruning causing the DF conflict to persist and report an error. This
> patch prunes before fetching, thus correcting DF conflicts during a
> fetch.
>
> Signed-off-by: Tom Miller
> ---
> builtin/fetch.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
Good catch.
I can't comment on the correctness of the patch right now, but here's a
test you could steal. It just reproduces what you describe, and I did
verify that it confirms the fix ;-)
diff --git i/t/t5510-fetch.sh w/t/t5510-fetch.sh
index 5d4581d..a981125 100755
--- i/t/t5510-fetch.sh
+++ w/t/t5510-fetch.sh
@@ -614,4 +614,18 @@ test_expect_success 'all boundary commits are excluded' '
test_bundle_object_count .git/objects/pack/pack-${pack##pack }.pack 3
'
+test_expect_success 'branchname D/F conflict resolved by --prune' '
+ git branch dir/file &&
+ git clone . prune-df-conflict &&
+ git branch -D dir/file &&
+ git branch dir &&
+ (
+ cd prune-df-conflict &&
+ git fetch --prune &&
+ git rev-parse origin/dir >../actual
+ ) &&
+ git rev-parse dir >expect &&
+ test_cmp expect actual
+'
+
test_done
--
Thomas Rast
tr@thomasrast.ch