From: Shawn Pearce <spearce@spearce.org>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: [RFC 6/5] Fix ref log parsing so it works properly.
Date: Wed, 17 May 2006 18:34:48 -0400 [thread overview]
Message-ID: <20060517223448.GE30313@spearce.org> (raw)
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.
---
Uh yea, I found a couple of bugs. :-)
This applies on top of the other 5 patches (hence the 6/5).
refs.c | 2 +-
sha1_name.c | 1 +
2 files changed, 2 insertions(+), 1 deletions(-)
fbc7bf049255370f1611a5772c39d35422a81e24
diff --git a/refs.c b/refs.c
index 4c99e37..ae9825d 100644
--- a/refs.c
+++ b/refs.c
@@ -459,7 +459,7 @@ int read_ref_at(const char *ref, unsigne
c++;
if (c == logend || *c == '\n')
die("Log %s is corrupt.", logfile);
- date = strtoul(c, NULL, 10);
+ date = strtoul(c + 1, NULL, 10);
if (date <= at_time) {
if (get_sha1_hex(rec + 41, sha1))
die("Log %s is corrupt.", logfile);
diff --git a/sha1_name.c b/sha1_name.c
index 3ac3ab4..4376cb3 100644
--- a/sha1_name.c
+++ b/sha1_name.c
@@ -267,6 +267,7 @@ static int get_sha1_basic(const char *st
at_time = approxidate(date_spec);
free(date_spec);
len = at_mark;
+ break;
}
}
--
1.3.2.g7278
reply other threads:[~2006-05-17 22:34 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060517223448.GE30313@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox