diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-10-10 15:56:18 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-10-10 15:56:18 -0700 |
commit | 9bd500048d467791902b1a5e8c22165325952fde (patch) | |
tree | 3cb1c07dd5c74e61cbcdf2405e17dcb7965eef0e /sha1_name.c | |
parent | 11fa509957025cc30c063d75014b701dd9ae235d (diff) | |
parent | dce4bab6567de7c458b334e029e3dedcab5f2648 (diff) | |
download | git-9bd500048d467791902b1a5e8c22165325952fde.tar.gz |
Merge branch 'mh/check-ref-format-3'
* mh/check-ref-format-3: (23 commits)
add_ref(): verify that the refname is formatted correctly
resolve_ref(): expand documentation
resolve_ref(): also treat a too-long SHA1 as invalid
resolve_ref(): emit warnings for improperly-formatted references
resolve_ref(): verify that the input refname has the right format
remote: avoid passing NULL to read_ref()
remote: use xstrdup() instead of strdup()
resolve_ref(): do not follow incorrectly-formatted symbolic refs
resolve_ref(): extract a function get_packed_ref()
resolve_ref(): turn buffer into a proper string as soon as possible
resolve_ref(): only follow a symlink that contains a valid, normalized refname
resolve_ref(): use prefixcmp()
resolve_ref(): explicitly fail if a symlink is not readable
Change check_refname_format() to reject unnormalized refnames
Inline function refname_format_print()
Make collapse_slashes() allocate memory for its result
Do not allow ".lock" at the end of any refname component
Refactor check_refname_format()
Change check_ref_format() to take a flags argument
Change bad_ref_char() to return a boolean value
...
Diffstat (limited to 'sha1_name.c')
-rw-r--r-- | sha1_name.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sha1_name.c b/sha1_name.c index 653b0659be..ba976b4839 100644 --- a/sha1_name.c +++ b/sha1_name.c @@ -966,9 +966,9 @@ int strbuf_check_branch_ref(struct strbuf *sb, const char *name) { strbuf_branchname(sb, name); if (name[0] == '-') - return CHECK_REF_FORMAT_ERROR; + return -1; strbuf_splice(sb, 0, 0, "refs/heads/", 11); - return check_ref_format(sb->buf); + return check_refname_format(sb->buf, 0); } /* |