summaryrefslogtreecommitdiff
path: root/t/t5510-fetch.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-04-03 19:38:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-04-03 19:38:18 (GMT)
commit400ecca8c10520ced800b4fcdd5bdeb94bd2a556 (patch)
tree7481b93198f9d9ac749f55b104a87e5f44ae4d65 /t/t5510-fetch.sh
parentb407d40933f9c37af16ca3dc275e615ab4fdd8c5 (diff)
parente6f637122ecd60c59df27b8188b6ddac39ac0063 (diff)
downloadgit-400ecca8c10520ced800b4fcdd5bdeb94bd2a556.zip
git-400ecca8c10520ced800b4fcdd5bdeb94bd2a556.tar.gz
git-400ecca8c10520ced800b4fcdd5bdeb94bd2a556.tar.bz2
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-xt/t5510-fetch.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 5acd753..29d59ef 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 &&