diff options
author | Michael Haggerty <mhagger@alum.mit.edu> | 2011-09-15 23:10:30 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-10-05 13:45:30 -0700 |
commit | a40e6fb67a4aed2d5ffde5792bf7f1996d9666e1 (patch) | |
tree | 25301632521d5e44177d076b255746679755ba92 /refs.c | |
parent | a5e4ec063afea050d09773f0aa5dcb95a82a31ec (diff) | |
download | git-a40e6fb67a4aed2d5ffde5792bf7f1996d9666e1.tar.gz |
Change check_refname_format() to reject unnormalized refnames
Since much of the infrastructure does not work correctly with
unnormalized refnames, change check_refname_format() to reject them.
Similarly, change "git check-ref-format" to reject unnormalized
refnames by default. But add an option --normalize, which causes "git
check-ref-format" to normalize the refname before checking its format,
and print the normalized refname. This is exactly the behavior of the
old --print option, which is retained but deprecated.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 3 |
1 files changed, 0 insertions, 3 deletions
@@ -908,9 +908,6 @@ int check_refname_format(const char *ref, int flags) int component_len, component_count = 0; while (1) { - while (*ref == '/') - ref++; /* tolerate leading and repeated slashes */ - /* We are at the start of a path component. */ component_len = check_refname_component(ref); if (component_len < 0) { |