1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-20 22:46:27 +02:00

wt-status: don't skip a magical number of characters blindly

Use the variable branch_name, which already has "refs/heads/" removed,
instead of blindly advancing in the ->branch string by 11 bytes.  This
is safer and less magical.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
René Scharfe 2015-10-31 18:37:12 +01:00 committed by Junio C Hamano
parent baf0a3e47d
commit 8d8325f8ee

View File

@ -1533,7 +1533,7 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
if (starts_with(branch_name, "refs/heads/"))
branch_name += 11;
branch = branch_get(s->branch + 11);
branch = branch_get(branch_name);
color_fprintf(s->fp, branch_color_local, "%s", branch_name);