diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-01-14 12:39:02 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-01-14 12:39:02 -0800 |
commit | 401a317aae36fd979da9eafbdd9415fa5ac6e119 (patch) | |
tree | 0ae841111da393a66958b531e2c6ab27c9fdf3b4 /builtin/for-each-ref.c | |
parent | 63a0e83ea6ea1e9d46bfd9e8c1298c6ca9f077ee (diff) | |
parent | b6160d950c9ef168d0f7d7c9b2812f280e5b88fb (diff) | |
download | git-401a317aae36fd979da9eafbdd9415fa5ac6e119.tar.gz git-401a317aae36fd979da9eafbdd9415fa5ac6e119.tar.xz |
Merge branch 'rc/for-each-ref-tracking'
* rc/for-each-ref-tracking:
for-each-ref: always check stat_tracking_info()'s return value
Diffstat (limited to 'builtin/for-each-ref.c')
-rw-r--r-- | builtin/for-each-ref.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c index f3ce004d5..a0123f614 100644 --- a/builtin/for-each-ref.c +++ b/builtin/for-each-ref.c @@ -717,7 +717,10 @@ static void populate_value(struct refinfo *ref) starts_with(name, "upstream")) { char buf[40]; - stat_tracking_info(branch, &num_ours, &num_theirs); + if (stat_tracking_info(branch, &num_ours, + &num_theirs) != 1) + continue; + if (!num_ours && !num_theirs) v->s = ""; else if (!num_ours) { @@ -735,7 +738,11 @@ static void populate_value(struct refinfo *ref) } else if (!strcmp(formatp, "trackshort") && starts_with(name, "upstream")) { assert(branch); - stat_tracking_info(branch, &num_ours, &num_theirs); + + if (stat_tracking_info(branch, &num_ours, + &num_theirs) != 1) + continue; + if (!num_ours && !num_theirs) v->s = "="; else if (!num_ours) |