diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-04-03 23:38:18 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-04-03 23:38:18 +0400 |
commit | 400ecca8c10520ced800b4fcdd5bdeb94bd2a556 (patch) | |
tree | 7481b93198f9d9ac749f55b104a87e5f44ae4d65 /t/t5510-fetch.sh | |
parent | b407d40933f9c37af16ca3dc275e615ab4fdd8c5 (diff) | |
parent | e6f637122ecd60c59df27b8188b6ddac39ac0063 (diff) |
Merge branch 'cn/fetch-prune-overlapping-destination'
Protect refs in a hierarchy that can come from more than one remote
hierarcies from incorrect removal by "git fetch --prune".
* cn/fetch-prune-overlapping-destination:
fetch: handle overlaping refspecs on --prune
fetch: add a failing test for prunning with overlapping refspecs
Diffstat (limited to 't/t5510-fetch.sh')
-rwxr-xr-x | t/t5510-fetch.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index 5acd753dcf..29d59ef9fa 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -113,6 +113,26 @@ test_expect_success 'fetch --prune with a namespace keeps other namespaces' ' git rev-parse origin/master ' +test_expect_success 'fetch --prune handles overlapping refspecs' ' + cd "$D" && + git update-ref refs/pull/42/head master && + git clone . prune-overlapping && + cd prune-overlapping && + git config --add remote.origin.fetch refs/pull/*/head:refs/remotes/origin/pr/* && + + git fetch --prune origin && + git rev-parse origin/master && + git rev-parse origin/pr/42 && + + git config --unset-all remote.origin.fetch + git config remote.origin.fetch refs/pull/*/head:refs/remotes/origin/pr/* && + git config --add remote.origin.fetch refs/heads/*:refs/remotes/origin/* && + + git fetch --prune origin && + git rev-parse origin/master && + git rev-parse origin/pr/42 +' + test_expect_success 'fetch --prune --tags prunes branches but not tags' ' cd "$D" && git clone . prune-tags && |