Code

for_each_reflog_ent: be forgiving about missing message
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>
Thu, 8 Feb 2007 23:59:47 +0000 (00:59 +0100)
committerJunio C Hamano <junkio@cox.net>
Fri, 9 Feb 2007 00:06:10 +0000 (16:06 -0800)
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>
refs.c

diff --git a/refs.c b/refs.c
index f3579457ce91e87af42eb6cb68aa791b91d66193..9e3dfb3c974c893760a6bcb75ecc39026f74a23b 100644 (file)
--- 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;