show-branch: show reflog message
Before, --reflog option would look for '\t' in the reflog message. As refs.c already parses the reflog line, the '\t' was never found, and show-branch --reflog would always say "(none)" as reflog message Add test. Signed-off-by: Han-Wen Nienhuys <hanwen@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
abe6bb3905
commit
f2463490c4
@ -761,6 +761,7 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
|
||||
char *logmsg;
|
||||
char *nth_desc;
|
||||
const char *msg;
|
||||
char *end;
|
||||
timestamp_t timestamp;
|
||||
int tz;
|
||||
|
||||
@ -770,11 +771,12 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
|
||||
reflog = i;
|
||||
break;
|
||||
}
|
||||
msg = strchr(logmsg, '\t');
|
||||
if (!msg)
|
||||
msg = "(none)";
|
||||
else
|
||||
msg++;
|
||||
|
||||
end = strchr(logmsg, '\n');
|
||||
if (end)
|
||||
*end = '\0';
|
||||
|
||||
msg = (*logmsg == '\0') ? "(none)" : logmsg;
|
||||
reflog_msg[i] = xstrfmt("(%s) %s",
|
||||
show_date(timestamp, tz,
|
||||
DATE_MODE(RELATIVE)),
|
||||
|
Reference in New Issue
Block a user