author | Junio C Hamano <junkio@cox.net> | |
Mon, 29 Jan 2007 08:57:07 +0000 (00:57 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 29 Jan 2007 08:57:07 +0000 (00:57 -0800) | ||
commit | a2f9fe92ebfdf9b5c458642fa0bf32b17433c6c1 | |
tree | d1484466557729e27ba4dda475dd8c6a2e918f2c | tree | snapshot |
parent | df391b192d285646fe80ca4d3cfe3c0a3beb5989 | commit | diff |
lock_any_ref_for_update(): do not accept malformatted refs.
We used to use lock_any_ref_for_update() because the command
needs to also update HEAD (which is not under refs/, so
lock_ref_sha1() cannot be used). The function however did not
check for refs with illegal characters in them.
Use check_ref_format() to catch malformed refs. For this check,
we specifically do not want to say having less than two levels
in the name is illegal to allow HEAD (and perhaps other special
refs in the future).
Signed-off-by: Junio C Hamano <junkio@cox.net>
We used to use lock_any_ref_for_update() because the command
needs to also update HEAD (which is not under refs/, so
lock_ref_sha1() cannot be used). The function however did not
check for refs with illegal characters in them.
Use check_ref_format() to catch malformed refs. For this check,
we specifically do not want to say having less than two levels
in the name is illegal to allow HEAD (and perhaps other special
refs in the future).
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-update-ref.c | diff | blob | history | |
refs.c | diff | blob | history |