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>
René Scharfe committed
Oct 31, 2015 at 18:37 UTC
8d8325f8ee3ef187a22743ccbedb978e52e3d095
1 file changed
+1
-1
wt-status.c
+1
-1
@@ -1533,7 +1533,7 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
1533
if (starts_with(branch_name, "refs/heads/"))
1534
branch_name += 11;
1535
1536
- branch = branch_get(s->branch + 11);
1536
+ branch = branch_get(branch_name);
1537
1538
color_fprintf(s->fp, branch_color_local, "%s", branch_name);
1539