wt-status: use separate variable for result of shorten_unambiguous_ref
commit5e8d2729ae64483efd5e8663cbc9d476364fb472
authorRené Scharfe <l.s.r@web.de>
Sat, 8 Jul 2017 10:51:01 +0000 (8 12:51 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Jul 2017 16:16:37 +0000 (10 09:16 -0700)
treee29606f21e89c0edc91f5d01394e44c82e5b7b98
parent8c8e978f5719c6a58fb998742207bf907f963143
wt-status: use separate variable for result of shorten_unambiguous_ref

Store the pointer to the string allocated by shorten_unambiguous_ref in
a dedicated variable, short_base, and keep base unchanged.  A non-const
variable is more appropriate for such an object.  It avoids having to
cast const away on free and stops redefining the meaning of base, making
the code slightly clearer.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
wt-status.c