@matheusbsbs / matheus-bagliano / commits / 70e34b2dc8
Fork 0

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>

Shawn Pearce committed May 17, 2006 at 18:34 UTC 70e34b2dc88e28f09903b85932ea679992da62ff
2 files changed +2 -1
refs.c
+1 -1
@@ -459,7 +459,7 @@ int read_ref_at(const char *ref, unsigned long at_time, unsigned char *sha1)
459 c++;
460 if (c == logend || *c == '\n')
461 die("Log %s is corrupt.", logfile);
462 - date = strtoul(c, NULL, 10);
462 + date = strtoul(c + 1, NULL, 10);
463 if (date <= at_time) {
464 if (get_sha1_hex(rec + 41, sha1))
465 die("Log %s is corrupt.", logfile);
sha1_name.c
+1
@@ -267,6 +267,7 @@ static int get_sha1_basic(const char *str, int len, unsigned char *sha1)
267 at_time = approxidate(date_spec);
268 free(date_spec);
269 len = at_mark;
270 + break;
271 }
272 }
273