remote.c: report specific errors from branch_get_upstream
[gitweb.git] / builtin / for-each-ref.c
index 008513c2f135b5a77d1642ff88e272a7e2f9f9d5..18d209bc9a2c49909d891a5190e51f2dd0ea9156 100644 (file)
@@ -664,10 +664,9 @@ static void populate_value(struct refinfo *ref)
                                continue;
                        branch = branch_get(ref->refname + 11);
 
-                       if (!branch || !branch->merge || !branch->merge[0] ||
-                           !branch->merge[0]->dst)
+                       refname = branch_get_upstream(branch, NULL);
+                       if (!refname)
                                continue;
-                       refname = branch->merge[0]->dst;
                } else if (starts_with(name, "color:")) {
                        char color[COLOR_MAXLEN] = "";
 
@@ -1060,7 +1059,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
 };