aboutsummaryrefslogtreecommitdiff
path: root/sha1_name.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-04-29 22:55:07 -0700
committerJunio C Hamano <gitster@pobox.com>2008-04-29 22:55:07 -0700
commit30c0312fd182942c10421e77d2b3ec6284cc0468 (patch)
treee72fda2a27115091cdb6352ebfaf1302dd814a7c /sha1_name.c
parent7b7f39eae6ab0bbcc68d3c42a5b23595880e528f (diff)
parentb3bb5f76e6193db102b063187be854ef3842d89b (diff)
downloadgit-30c0312fd182942c10421e77d2b3ec6284cc0468.tar.gz
git-30c0312fd182942c10421e77d2b3ec6284cc0468.tar.xz
Merge branch 'maint-1.5.4' into maint
* maint-1.5.4: cvsimport: always pass user data to "system" as a list fix reflog approxidate parsing bug
Diffstat (limited to 'sha1_name.c')
-rw-r--r--sha1_name.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sha1_name.c b/sha1_name.c
index 491d2e7eb..b0b216757 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -351,8 +351,11 @@ static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
}
if (0 <= nth)
at_time = 0;
- else
- at_time = approxidate(str + at + 2);
+ else {
+ char *tmp = xstrndup(str + at + 2, reflog_len);
+ at_time = approxidate(tmp);
+ free(tmp);
+ }
if (read_ref_at(real_ref, at_time, nth, sha1, NULL,
&co_time, &co_tz, &co_cnt)) {
if (at_time)