diff options
author | Tom Miller <jackerran@gmail.com> | 2014-01-02 20:28:52 -0600 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-01-03 10:18:40 -0800 |
commit | 10a6cc8890ec1e5459c05ddeb28a671acdc37d60 (patch) | |
tree | b94074e834f8b4d77217e9df35c8d4d76a21a0ea /t | |
parent | fetch --prune: always print header url (diff) | |
download | tgif-10a6cc8890ec1e5459c05ddeb28a671acdc37d60.tar.xz |
fetch --prune: Run prune before fetching
When we have a remote-tracking branch named "frotz/nitfol" from a
previous fetch, and the upstream now has a branch named "frotz",
fetch would fail to remove "frotz/nitfol" with a "git fetch --prune"
from the upstream. git would inform the user to use "git remote
prune" to fix the problem.
Change the way "fetch --prune" works by moving the pruning operation
before the fetching operation. This way, instead of warning the user
of a conflict, it autmatically fixes it.
Signed-off-by: Tom Miller <jackerran@gmail.com>
Tested-by: Thomas Rast <tr@thomasrast.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t5510-fetch.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index 87e896d3a3..12674ac098 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -626,4 +626,18 @@ test_expect_success 'fetch --prune prints the remotes url' ' test_cmp expect actual ' +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 |