From: Junio C Hamano Date: Mon, 27 Jan 2014 18:44:13 +0000 (-0800) Subject: Merge branch 'jk/allow-fetch-onelevel-refname' X-Git-Tag: v1.9-rc1~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f583ace15762e2f9f68ccfcf0ec0e0527b2a899d;p=git Merge branch 'jk/allow-fetch-onelevel-refname' "git clone" would fail to clone from a repository that has a ref directly under "refs/", e.g. "refs/stash", because different validation paths do different things on such a refname. Loosen the client side's validation to allow such a ref. * jk/allow-fetch-onelevel-refname: fetch-pack: do not filter out one-level refs --- f583ace15762e2f9f68ccfcf0ec0e0527b2a899d diff --cc t/t5510-fetch.sh index 12674ac098,d52ef7fe80..ab28594c62 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@@ -614,30 -512,15 +614,41 @@@ test_expect_success 'all boundary commi test_bundle_object_count .git/objects/pack/pack-${pack##pack }.pack 3 ' +test_expect_success 'fetch --prune prints the remotes url' ' + git branch goodbye && + git clone . only-prunes && + git branch -D goodbye && + ( + cd only-prunes && + git fetch --prune origin 2>&1 | head -n1 >../actual + ) && + echo "From ${D}/." >expect && + test_cmp expect actual +' + +test_expect_success 'branchname D/F conflict resolved by --prune' ' + git branch dir/file && + git clone . prune-df-conflict && + git branch -D dir/file && + git branch dir && + ( + cd prune-df-conflict && + git fetch --prune && + git rev-parse origin/dir >../actual + ) && + git rev-parse dir >expect && + test_cmp expect actual +' + + test_expect_success 'fetching a one-level ref works' ' + test_commit extra && + git reset --hard HEAD^ && + git update-ref refs/foo extra && + git init one-level && + ( + cd one-level && + git fetch .. HEAD refs/foo + ) + ' + test_done