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>
This commit is contained in:
Johannes Schindelin 2007-02-09 00:59:47 +01:00 committed by Junio C Hamano
parent 05b07ab963
commit b4dd485696

6
refs.c
View File

@ -1192,11 +1192,13 @@ 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);
if (message[6] != '\t')
message += 6;
else
message += 7;
ret = fn(osha1, nsha1, buf+82, timestamp, tz, message, cb_data);
if (ret)