summaryrefslogtreecommitdiff
path: root/t/t5510-fetch.sh
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@elego.de>2011-10-15 05:04:25 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-10-16 04:56:13 (GMT)
commited43de6ec35dfd4c4bd33ae9b5f2ebe38282209f (patch)
tree941a49f45a789b247840f52e74183a52a066500b /t/t5510-fetch.sh
parentc500352e0de75db34b1a071a9e250b815d10f95b (diff)
downloadgit-ed43de6ec35dfd4c4bd33ae9b5f2ebe38282209f.zip
git-ed43de6ec35dfd4c4bd33ae9b5f2ebe38282209f.tar.gz
git-ed43de6ec35dfd4c4bd33ae9b5f2ebe38282209f.tar.bz2
fetch: honor the user-provided refspecs when pruning refs
If the user gave us refspecs on the command line, we should use those when deciding whether to prune a ref instead of relying on the refspecs in the config. Previously, running git fetch --prune origin refs/heads/master:refs/remotes/origin/master would delete every other ref under the origin namespace because we were using the refspec to filter the available refs but using the configured refspec to figure out if a ref had been deleted on the remote. This is clearly the wrong thing to do. Change prune_refs and get_stale_heads to simply accept a list of references and a list of refspecs. The caller of either function needs to decide what refspecs should be used to decide whether a ref is stale. Signed-off-by: Carlos Martín Nieto <cmn@elego.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5510-fetch.sh')
-rwxr-xr-xt/t5510-fetch.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 8b5e925..581049b 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -86,7 +86,7 @@ test_expect_success 'fetch --prune on its own works as expected' '
test_must_fail git rev-parse origin/extrabranch
'
-test_expect_failure 'fetch --prune with a branch name keeps branches' '
+test_expect_success 'fetch --prune with a branch name keeps branches' '
cd "$D" &&
git clone . prune-branch &&
cd prune-branch &&
@@ -96,7 +96,7 @@ test_expect_failure 'fetch --prune with a branch name keeps branches' '
git rev-parse origin/extrabranch
'
-test_expect_failure 'fetch --prune with a namespace keeps other namespaces' '
+test_expect_success 'fetch --prune with a namespace keeps other namespaces' '
cd "$D" &&
git clone . prune-namespace &&
cd prune-namespace &&