aboutsummaryrefslogtreecommitdiff
path: root/sha1_name.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-01-27 14:57:37 -0800
committerJunio C Hamano <gitster@pobox.com>2010-01-27 14:57:37 -0800
commit103209c6782586d92b04ee1fc71c0fd6f6385f5f (patch)
tree6add5ef9c0464315cbfceb3e11beaf95caf731e3 /sha1_name.c
parent68186857a9bb0a71e9456155623e02d398a5b817 (diff)
parent6c647af3060b8dd20da0e0b21dcd0eb95ec70841 (diff)
downloadgit-103209c6782586d92b04ee1fc71c0fd6f6385f5f.tar.gz
git-103209c6782586d92b04ee1fc71c0fd6f6385f5f.tar.xz
Merge branch 'jc/maint-reflog-bad-timestamp'
* jc/maint-reflog-bad-timestamp: t0101: use a fixed timestamp when searching in the reflog Update @{bogus.timestamp} fix not to die() approxidate_careful() reports errorneous date string
Diffstat (limited to 'sha1_name.c')
-rw-r--r--sha1_name.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sha1_name.c b/sha1_name.c
index 9215ad1d0..c7f1510ef 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -413,9 +413,12 @@ static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
} else if (0 <= nth)
at_time = 0;
else {
+ int errors = 0;
char *tmp = xstrndup(str + at + 2, reflog_len);
- at_time = approxidate(tmp);
+ at_time = approxidate_careful(tmp, &errors);
free(tmp);
+ if (errors)
+ return -1;
}
if (read_ref_at(real_ref, at_time, nth, sha1, NULL,
&co_time, &co_tz, &co_cnt)) {