diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-01-02 11:14:40 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-01-02 11:20:09 -0800 |
commit | 257f3020f69f3222cdefc1d84b148fb35b2c4f5b (patch) | |
tree | 4cc7eddab646adc89a5e540f28f2d98abe92ca0b /builtin-send-pack.c | |
parent | 321b1842dceb94bbaa00b9f75c7c2fe6bf6fad1c (diff) | |
download | git-257f3020f69f3222cdefc1d84b148fb35b2c4f5b.tar.gz git-257f3020f69f3222cdefc1d84b148fb35b2c4f5b.tar.xz |
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 'builtin-send-pack.c')
-rw-r--r-- | builtin-send-pack.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/builtin-send-pack.c b/builtin-send-pack.c index 25ae1fe86..8afb1d0bc 100644 --- a/builtin-send-pack.c +++ b/builtin-send-pack.c @@ -541,10 +541,12 @@ static void verify_remote_names(int nr_heads, const char **heads) remote = remote ? (remote + 1) : heads[i]; switch (check_ref_format(remote)) { case 0: /* ok */ - case -2: /* ok but a single level -- that is fine for - * a match pattern. - */ - case -3: /* ok but ends with a pattern-match character */ + case CHECK_REF_FORMAT_ONELEVEL: + /* ok but a single level -- that is fine for + * a match pattern. + */ + case CHECK_REF_FORMAT_WILDCARD: + /* ok but ends with a pattern-match character */ continue; } die("remote part of refspec is not a valid name in %s", |