summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Michael Haggerty <mhagger@alum.mit.edu>2013-10-23 17:50:36 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-10-24 13:27:46 -0700
commit68a304d5fed6657e452e8c1571fe9ca93d0a272a (patch)
treeb76912784f616f0aabf1b721fcad79cf4b0cbbf8
parentt5510: prepare test refs more straightforwardly (diff)
downloadtgif-68a304d5fed6657e452e8c1571fe9ca93d0a272a.tar.xz
t5510: check that "git fetch --prune --tags" does not prune branches
"git fetch --prune --tags" is currently interpreted as follows: * "--tags" is equivalent to specifying a refspec "refs/tags/*:refs/tags/*", and supersedes any default refspecs configured via remote.$REMOTE.fetch. * "--prune" only operates on the refspecs being fetched. Therefore, "git fetch --prune --tags" prunes tags in refs/tags/* but does not fetch or prune other references. The fact that this command does not prune references outside of refs/tags/* was previously untested. So add a test that verifies the status quo. However, the status quo is surprising, so it will be changed later in this patch series. Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xt/t5510-fetch.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh
index 08d8dbb917..8328be1347 100755
--- a/t/t5510-fetch.sh
+++ b/t/t5510-fetch.sh
@@ -118,9 +118,13 @@ test_expect_success 'fetch --prune --tags does not delete the remote-tracking br
git clone . prune-tags &&
cd prune-tags &&
git tag sometag master &&
+ # Create what looks like a remote-tracking branch from an earlier
+ # fetch that has since been deleted from the remote:
+ git update-ref refs/remotes/origin/fake-remote master &&
git fetch --prune --tags origin &&
git rev-parse origin/master &&
+ git rev-parse origin/fake-remote &&
test_must_fail git rev-parse sometag
'