summaryrefslogtreecommitdiff
path: root/refs.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2007-02-09 00:59:47 +0100
committerJunio C Hamano <junkio@cox.net>2007-02-08 16:06:10 -0800
commitb4dd485696d9fb754b0a44649ef4796883d3b903 (patch)
tree088fe5355b60e1349f689c84626e232efbb5b849 /refs.c
parent05b07ab9632dc233bf9eebad04256e06a8cbcb35 (diff)
downloadgit-b4dd485696d9fb754b0a44649ef4796883d3b903.tar.gz
for_each_reflog_ent: be forgiving about missing message
Some reflogs are/were generated without a message; do not plainly ignore those entries. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'refs.c')
-rw-r--r--refs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/refs.c b/refs.c
index f3579457ce..9e3dfb3c97 100644
--- a/refs.c
+++ b/refs.c
@@ -1192,12 +1192,14 @@ int for_each_reflog_ent(const char *ref, each_reflog_ent_fn fn, void *cb_data)
!message || message[0] != ' ' ||
(message[1] != '+' && message[1] != '-') ||
!isdigit(message[2]) || !isdigit(message[3]) ||
- !isdigit(message[4]) || !isdigit(message[5]) ||
- message[6] != '\t')
+ !isdigit(message[4]) || !isdigit(message[5]))
continue; /* corrupt? */
email_end[1] = '\0';
tz = strtol(message + 1, NULL, 10);
- message += 7;
+ if (message[6] != '\t')
+ message += 6;
+ else
+ message += 7;
ret = fn(osha1, nsha1, buf+82, timestamp, tz, message, cb_data);
if (ret)
break;