refs: loosen over-strict "format" check

The add_extra_ref() interface is used to add an extra-ref that is _not_
our ref for the purpose of helping auto-following of tags and reducing
object transfer from remote repository, and they are typically formatted
as a tagname followed by ^{} to make sure no valid refs match that
pattern. In other words, these entries are deliberately formatted not to
pass check-refname-format test.

A recent series however added a test unconditionally to the add_ref()
function that is called from add_extra_ref(). The check may be sensible
for other two callsites of the add_ref() interface, but definitely is
a wrong thing to do in add_extra_ref(). Disable it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
This commit is contained in:
Junio C Hamano
2011-11-16 16:54:32 -08:00
parent 5e1e6b93d0
commit 09116a1c31
2 changed files with 17 additions and 10 deletions

View File

@@ -146,4 +146,11 @@ test_expect_success 'cloning with reference being subset of source (-l -s)' \
cd "$base_dir"
test_expect_success 'clone with reference from a tagged repository' '
(
cd A && git tag -a -m 'tagged' HEAD
) &&
git clone --reference=A A I
'
test_done