mirror of
https://github.com/git/git.git
synced 2025-01-19 14:04:07 +08: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:
parent
baf0a3e47d
commit
8d8325f8ee
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user