Re: [PATCH 7/9] ref-filter: make %(upstream:track) prints "[gone]" for invalid upstreams
- From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
- Date
- Oct 3, 2015, 12:08 UTC
- Message-ID
- <vpqio6o9mu1.fsf@grenoble-inp.fr>
- In-Reply-To
- <1443807546-5985-8-git-send-email-Karthik.188@gmail.com>
Karthik Nayak <karthik.188@gmail.com> writes:
Show 11 quoted lines
> diff --git a/ref-filter.c b/ref-filter.c
> index 099acd6..48b06e3 100644
> --- a/ref-filter.c
> +++ b/ref-filter.c
> @@ -1133,8 +1133,10 @@ static void populate_value(struct ref_array_item *ref)
> char buf[40];
>
> if (stat_tracking_info(branch, &num_ours,
> - &num_theirs, NULL))
> + &num_theirs, NULL)) {
> + v->s = xstrdup("[gone]");I think just "[gone]" without the xstrdup is OK, and avoids leaking one string.
-- Matthieu Moy http://www-verimag.imag.fr/~moy/