diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-04-03 12:38:18 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-04-03 12:38:18 -0700 |
commit | 400ecca8c10520ced800b4fcdd5bdeb94bd2a556 (patch) | |
tree | 7481b93198f9d9ac749f55b104a87e5f44ae4d65 /t | |
parent | b407d40933f9c37af16ca3dc275e615ab4fdd8c5 (diff) | |
parent | e6f637122ecd60c59df27b8188b6ddac39ac0063 (diff) | |
download | git-400ecca8c10520ced800b4fcdd5bdeb94bd2a556.tar.gz git-400ecca8c10520ced800b4fcdd5bdeb94bd2a556.tar.xz |
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')
-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 5acd753dc..29d59ef9f 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 && |