Merge branch 'sb/plug-leak-in-make-cache-entry'
[gitweb.git] / builtin / for-each-ref.c
index 603a90e29b808a86fa39f031d13a1ca94f5d236e..19be78a943d303700379f665d64c8843c69848d5 100644 (file)
@@ -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)
@@ -1054,7 +1061,7 @@ static int opt_parse_sort(const struct option *opt, const char *arg, int unset)
 }
 
 static char const * const for_each_ref_usage[] = {
-       N_("git for-each-ref [options] [<pattern>]"),
+       N_("git for-each-ref [<options>] [<pattern>]"),
        NULL
 };
 
@@ -1075,7 +1082,7 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
                OPT_BIT(0 , "python", &quote_style,
                        N_("quote placeholders suitably for python"), QUOTE_PYTHON),
                OPT_BIT(0 , "tcl",  &quote_style,
-                       N_("quote placeholders suitably for tcl"), QUOTE_TCL),
+                       N_("quote placeholders suitably for Tcl"), QUOTE_TCL),
 
                OPT_GROUP(""),
                OPT_INTEGER( 0 , "count", &maxcount, N_("show only <n> matched refs")),