Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-09-06 22:42:52 +0400
committerJunio C Hamano <gitster@pobox.com>2011-09-06 22:42:52 +0400
commit4b1108eec79ffb35d651a2dd8277973ed3b5cc6b (patch)
treed9644d2402be271e4e3ee44f4446c8e4866194b1 /builtin
parent48f36dcd7320d27a840e89fc2aa7ab11716951c6 (diff)
parentf3738c1ce9193a4bf45ba1a3ea67d0cf32da0257 (diff)
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.c6
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)