summaryrefslogtreecommitdiff
path: root/wt-status.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2015-10-31 18:37:12 +0100
committerJunio C Hamano <gitster@pobox.com>2015-11-01 09:58:20 -0800
commit8d8325f8ee3ef187a22743ccbedb978e52e3d095 (patch)
treef8496b29ab9aabe6254a14ae7a4e967e29aeced4 /wt-status.c
parentbaf0a3e47d807b63e9fc5628caa455d1da91dd6c (diff)
downloadgit-8d8325f8ee3ef187a22743ccbedb978e52e3d095.tar.gz
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>
Diffstat (limited to 'wt-status.c')
-rw-r--r--wt-status.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/wt-status.c b/wt-status.c
index 0e4a04e695..ca6811118c 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -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);