summaryrefslogtreecommitdiff
path: root/wt-status.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-07-12 15:18:23 -0700
committerJunio C Hamano <gitster@pobox.com>2017-07-12 15:18:23 -0700
commit094aa09aa59cd9fc417aa250f6ac46e602b40325 (patch)
tree3c7f993e761d79b2b0dd7a597f80436a17f1dc29 /wt-status.c
parentf056cde60e7b095edf1530554a8c9528bd8b374b (diff)
parent5e8d2729ae64483efd5e8663cbc9d476364fb472 (diff)
downloadgit-094aa09aa59cd9fc417aa250f6ac46e602b40325.tar.gz
Merge branch 'rs/wt-status-cleanup'
Code cleanup. * rs/wt-status-cleanup: wt-status: use separate variable for result of shorten_unambiguous_ref
Diffstat (limited to 'wt-status.c')
-rw-r--r--wt-status.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/wt-status.c b/wt-status.c
index 8d2fb35b08..77c27c5113 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -1763,6 +1763,7 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
const char *branch_color_remote = color(WT_STATUS_REMOTE_BRANCH, s);
const char *base;
+ char *short_base;
const char *branch_name;
int num_ours, num_theirs;
int upstream_is_gone = 0;
@@ -1797,10 +1798,10 @@ static void wt_shortstatus_print_tracking(struct wt_status *s)
upstream_is_gone = 1;
}
- base = shorten_unambiguous_ref(base, 0);
+ short_base = shorten_unambiguous_ref(base, 0);
color_fprintf(s->fp, header_color, "...");
- color_fprintf(s->fp, branch_color_remote, "%s", base);
- free((char *)base);
+ color_fprintf(s->fp, branch_color_remote, "%s", short_base);
+ free(short_base);
if (!upstream_is_gone && !num_ours && !num_theirs)
goto conclude;