summaryrefslogtreecommitdiff
path: root/refs.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 /refs.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 'refs.c')
-rw-r--r--refs.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/refs.c b/refs.c
index 7484a46d68..58f6d17397 100644
--- a/refs.c
+++ b/refs.c
@@ -822,10 +822,10 @@ struct ref_lock *lock_ref_sha1(const char *ref, const unsigned char *old_sha1)
struct ref_lock *lock_any_ref_for_update(const char *ref, const unsigned char *old_sha1, int flags)
{
switch (check_ref_format(ref)) {
- case CHECK_REF_FORMAT_ERROR:
- case CHECK_REF_FORMAT_WILDCARD:
- return NULL;
default:
+ return NULL;
+ case 0:
+ case CHECK_REF_FORMAT_ONELEVEL:
return lock_ref_sha1_basic(ref, old_sha1, flags, NULL);
}
}