summaryrefslogtreecommitdiff
path: root/fast-import.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-01-02 11:14:40 -0800
committerJunio C Hamano <gitster@pobox.com>2008-01-02 11:20:09 -0800
commit257f3020f69f3222cdefc1d84b148fb35b2c4f5b (patch)
tree4cc7eddab646adc89a5e540f28f2d98abe92ca0b /fast-import.c
parent321b1842dceb94bbaa00b9f75c7c2fe6bf6fad1c (diff)
downloadgit-257f3020f69f3222cdefc1d84b148fb35b2c4f5b.tar.gz
Update callers of check_ref_format()
This updates send-pack and fast-import to use symbolic constants for checking the return values from check_ref_format(), and also futureproof the logic in lock_any_ref_for_update() to explicitly name the case that is usually considered an error but is Ok for this particular use. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fast-import.c')
-rw-r--r--fast-import.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fast-import.c b/fast-import.c
index 4646c056f3..74597c901c 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -642,8 +642,9 @@ static struct branch *new_branch(const char *name)
if (b)
die("Invalid attempt to create duplicate branch: %s", name);
switch (check_ref_format(name)) {
- case 0: break; /* its valid */
- case -2: break; /* valid, but too few '/', allow anyway */
+ case 0: break; /* its valid */
+ case CHECK_REF_FORMAT_ONELEVEL:
+ break; /* valid, but too few '/', allow anyway */
default:
die("Branch name doesn't conform to GIT standards: %s", name);
}