diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-09-06 11:42:52 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-09-06 11:42:52 -0700 |
commit | 4b1108eec79ffb35d651a2dd8277973ed3b5cc6b (patch) | |
tree | d9644d2402be271e4e3ee44f4446c8e4866194b1 /builtin | |
parent | Sync with 1.7.6.2 (diff) | |
parent | Forbid DEL characters in reference names (diff) | |
download | tgif-4b1108eec79ffb35d651a2dd8277973ed3b5cc6b.tar.xz |
Merge branch 'mh/check-ref-format-print-normalize'
* mh/check-ref-format-print-normalize:
Forbid DEL characters in reference names
check-ref-format --print: Normalize refnames that start with slashes
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/check-ref-format.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/check-ref-format.c b/builtin/check-ref-format.c index ae3f28115a..0723cf245e 100644 --- a/builtin/check-ref-format.c +++ b/builtin/check-ref-format.c @@ -12,8 +12,8 @@ static const char builtin_check_ref_format_usage[] = " or: git check-ref-format --branch <branchname-shorthand>"; /* - * Replace each run of adjacent slashes in src with a single slash, - * and write the result to dst. + * Remove leading slashes and replace each run of adjacent slashes in + * src with a single slash, and write the result to dst. * * This function is similar to normalize_path_copy(), but stripped down * to meet check_ref_format's simpler needs. @@ -21,7 +21,7 @@ static const char builtin_check_ref_format_usage[] = static void collapse_slashes(char *dst, const char *src) { char ch; - char prev = '\0'; + char prev = '/'; while ((ch = *src++) != '\0') { if (prev == '/' && ch == prev) |