Skip to content

Commit a5e10ac

Browse files
committed
Update @{bogus.timestamp} fix not to die()
The caller will say "It is not a valid object name" if it wants to, and some callers may even try to see if it names an object and otherwise try to see if it is a path. Pointed out by Jeff King. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 93cfa7c commit a5e10ac

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sha1_name.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,9 @@ static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
398398
int errors = 0;
399399
char *tmp = xstrndup(str + at + 2, reflog_len);
400400
at_time = approxidate_careful(tmp, &errors);
401-
if (errors)
402-
die("Bogus timestamp '%s'", tmp);
403401
free(tmp);
402+
if (errors)
403+
return -1;
404404
}
405405
if (read_ref_at(real_ref, at_time, nth, sha1, NULL,
406406
&co_time, &co_tz, &co_cnt)) {

0 commit comments

Comments
 (0)