]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/for-each-ref.c
remote.c: introduce branch_get_upstream helper
[thirdparty/git.git] / builtin / for-each-ref.c
index 83f9cf91633a514e9301762fe774ee91be092848..dc2a201a451fd3d276aa5030ef55789129f85bb3 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);
+                       if (!refname)
                                continue;
-                       refname = branch->merge[0]->dst;
                } else if (starts_with(name, "color:")) {
                        char color[COLOR_MAXLEN] = "";