Skip to content

Commit 8d8325f

Browse files
rscharfegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent baf0a3e commit 8d8325f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

wt-status.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1533,7 +1533,7 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
15331533
if (starts_with(branch_name, "refs/heads/"))
15341534
branch_name += 11;
15351535

1536-
branch = branch_get(s->branch + 11);
1536+
branch = branch_get(branch_name);
15371537

15381538
color_fprintf(s->fp, branch_color_local, "%s", branch_name);
15391539

0 commit comments

Comments
 (0)