Fix ref log parsing so it works properly.
The log parser was only ever matching the last log record due to calling strtoul on "> 1136091609" rather than " 1136091609". Also once a match for '@' has been found after the name of the ref there is no point in looking for another '@' within the remaining text. Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
d556fae2c0
commit
70e34b2dc8
2
refs.c
2
refs.c
@ -459,7 +459,7 @@ int read_ref_at(const char *ref, unsigned long at_time, unsigned char *sha1)
|
|||||||
c++;
|
c++;
|
||||||
if (c == logend || *c == '\n')
|
if (c == logend || *c == '\n')
|
||||||
die("Log %s is corrupt.", logfile);
|
die("Log %s is corrupt.", logfile);
|
||||||
date = strtoul(c, NULL, 10);
|
date = strtoul(c + 1, NULL, 10);
|
||||||
if (date <= at_time) {
|
if (date <= at_time) {
|
||||||
if (get_sha1_hex(rec + 41, sha1))
|
if (get_sha1_hex(rec + 41, sha1))
|
||||||
die("Log %s is corrupt.", logfile);
|
die("Log %s is corrupt.", logfile);
|
||||||
|
@ -267,6 +267,7 @@ static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
|
|||||||
at_time = approxidate(date_spec);
|
at_time = approxidate(date_spec);
|
||||||
free(date_spec);
|
free(date_spec);
|
||||||
len = at_mark;
|
len = at_mark;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user