author | Junio C Hamano <junkio@cox.net> | |
Thu, 15 Dec 2005 20:54:00 +0000 (12:54 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 15 Dec 2005 20:54:00 +0000 (12:54 -0800) | ||
commit | 6677c4665af2d73f670bec382bc82d0f2e9513fb | |
tree | 7197059b14f5e6b820d2b8708434347160ef26e6 | tree | snapshot |
parent | 8431c4eb0976b0558eaa1df475ce6de6b52ce484 | commit | diff |
get_sha1_basic(): corner case ambiguity fix
When .git/refs/heads/frotz and .git/refs/tags/frotz existed, and
the object name stored in .git/refs/heads/frotz were corrupt, we
ended up picking tags/frotz without complaining. Worse yet, if
the corrupt .git/refs/heads/frotz was more than 40 bytes and
began with hexadecimal characters, it silently overwritten the
initial part of the returned result.
This commit adds a couple of tests to demonstrate these cases,
with a fix.
Signed-off-by: Junio C Hamano <junkio@cox.net>
When .git/refs/heads/frotz and .git/refs/tags/frotz existed, and
the object name stored in .git/refs/heads/frotz were corrupt, we
ended up picking tags/frotz without complaining. Worse yet, if
the corrupt .git/refs/heads/frotz was more than 40 bytes and
began with hexadecimal characters, it silently overwritten the
initial part of the returned result.
This commit adds a couple of tests to demonstrate these cases,
with a fix.
Signed-off-by: Junio C Hamano <junkio@cox.net>
sha1_name.c | diff | blob | history | |
t/t0000-basic.sh | diff | blob | history | |
t/test-lib.sh | diff | blob | history |