{"thread":{"id":"4188","subject":"[RFC 6/5] Fix ref log parsing so it works properly.","startedAt":"2006-05-17T22:34:48Z","lastAt":"2006-05-17T22:34:48Z","messageCount":1,"participants":["Shawn Pearce"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"20191","messageId":"20060517223448.GE30313@spearce.org","threadId":"4188","inReplyTo":null,"subject":"[RFC 6/5] Fix ref log parsing so it works properly.","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2006-05-17T22:34:48Z","receivedAt":"2006-05-17T22:34:48Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"The log parser was only ever matching the last log record due to\ncalling strtoul on \"> 1136091609\" rather than \" 1136091609\".  Also\nonce a match for '@' has been found after the name of the ref there\nis no point in looking for another '@' within the remaining text.\n\n---\n Uh yea, I found a couple of bugs.  :-)\n This applies on top of the other 5 patches (hence the 6/5).\n\n refs.c      |    2 +-\n sha1_name.c |    1 +\n 2 files changed, 2 insertions(+), 1 deletions(-)\n\nfbc7bf049255370f1611a5772c39d35422a81e24\ndiff --git a/refs.c b/refs.c\nindex 4c99e37..ae9825d 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -459,7 +459,7 @@ int read_ref_at(const char *ref, unsigne\n \t\t\tc++;\n \t\tif (c == logend || *c == '\\n')\n \t\t\tdie(\"Log %s is corrupt.\", logfile);\n-\t\tdate = strtoul(c, NULL, 10);\n+\t\tdate = strtoul(c + 1, NULL, 10);\n \t\tif (date <= at_time) {\n \t\t\tif (get_sha1_hex(rec + 41, sha1))\n \t\t\t\tdie(\"Log %s is corrupt.\", logfile);\ndiff --git a/sha1_name.c b/sha1_name.c\nindex 3ac3ab4..4376cb3 100644\n--- a/sha1_name.c\n+++ b/sha1_name.c\n@@ -267,6 +267,7 @@ static int get_sha1_basic(const char *st\n \t\t\tat_time = approxidate(date_spec);\n \t\t\tfree(date_spec);\n \t\t\tlen = at_mark;\n+\t\t\tbreak;\n \t\t}\n \t}\n \n-- \n1.3.2.g7278\n"}]}