author | Jeff King <peff@peff.net> | |
Wed, 30 Apr 2008 04:13:58 +0000 (00:13 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 30 Apr 2008 05:22:19 +0000 (22:22 -0700) | ||
commit | 861f00e3496fd5cd866a73f11826dfc8822a5195 | |
tree | b651073ae4a7e7f005c2016498d614f61cf3b7b3 | tree | snapshot |
parent | 362b0dd523f5162e7c55c76b5d0af7ad830e0e83 | commit | diff |
fix reflog approxidate parsing bug
In get_sha1_basic, we parse a string like
HEAD@{10 seconds ago}:path/to/file
into its constituent ref, reflog date, and path components.
We never actually munge the string itself, but instead keep
offsets into the string with their associated lengths.
When we call approxidate on the contents inside braces,
however, we pass just a string without a length. This means
that approxidate could sometimes look past the closing brace
and (erroneously) interpret the rest of the string as part
of the date.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
In get_sha1_basic, we parse a string like
HEAD@{10 seconds ago}:path/to/file
into its constituent ref, reflog date, and path components.
We never actually munge the string itself, but instead keep
offsets into the string with their associated lengths.
When we call approxidate on the contents inside braces,
however, we pass just a string without a length. This means
that approxidate could sometimes look past the closing brace
and (erroneously) interpret the rest of the string as part
of the date.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_name.c | diff | blob | history |