summaryrefslogtreecommitdiff
path: root/environment.c
diff options
context:
space:
mode:
authorMichael Haggerty <mhagger@alum.mit.edu>2011-09-15 23:10:25 +0200
committerJunio C Hamano <gitster@pobox.com>2011-10-05 13:45:29 -0700
commit8d9c50105f908b2adde4b7c77537cf95f19cd893 (patch)
tree91e783b9cca8d2bac7913057b9caf28c948822e1 /environment.c
parent9224b73be03845a99f8171c57dc282f806b70f4c (diff)
downloadgit-8d9c50105f908b2adde4b7c77537cf95f19cd893.tar.gz
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 <mhagger@alum.mit.edu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'environment.c')
-rw-r--r--environment.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/environment.c b/environment.c
index e96edcfebc..8174b703c4 100644
--- a/environment.c
+++ b/environment.c
@@ -106,7 +106,7 @@ static char *expand_namespace(const char *raw_namespace)
if (strcmp((*c)->buf, "/") != 0)
strbuf_addf(&buf, "refs/namespaces/%s", (*c)->buf);
strbuf_list_free(components);
- if (check_ref_format(buf.buf) != CHECK_REF_FORMAT_OK)
+ if (check_refname_format(buf.buf, 0))
die("bad git namespace path \"%s\"", raw_namespace);
strbuf_addch(&buf, '/');
return strbuf_detach(&buf, NULL);