path: root/walker.c
diff options
authorMichael Haggerty <>2011-09-15 21:10:25 (GMT)
committerJunio C Hamano <>2011-10-05 20:45:29 (GMT)
commit8d9c50105f908b2adde4b7c77537cf95f19cd893 (patch)
tree91e783b9cca8d2bac7913057b9caf28c948822e1 /walker.c
parent9224b73be03845a99f8171c57dc282f806b70f4c (diff)
Change check_ref_format() to take a flags argument
Change check_ref_format() to take a flags argument that indicates what is acceptable in the reference name (analogous to "git check-ref-format"'s "--allow-onelevel" and "--refspec-pattern"). This is more convenient for callers and also fixes a failure in the test suite (and likely elsewhere in the code) by enabling "onelevel" and "refspec-pattern" to be allowed independently of each other. Also rename check_ref_format() to check_refname_format() to make it obvious that it deals with refnames rather than references themselves. Signed-off-by: Michael Haggerty <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'walker.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/walker.c b/walker.c
index dce7128..be389dc 100644
--- a/walker.c
+++ b/walker.c
@@ -190,7 +190,7 @@ static int interpret_target(struct walker *walker, char *target, unsigned char *
if (!get_sha1_hex(target, sha1))
return 0;
- if (!check_ref_format(target)) {
+ if (!check_refname_format(target, 0)) {
struct ref *ref = alloc_ref(target);
if (!walker->fetch_ref(walker, ref)) {
hashcpy(sha1, ref->old_sha1);