Merge branch 'lt/commit-tree-guess-utf-8'
[gitweb.git] / builtin / for-each-ref.c
index d90e5d2b29f9ac72a104d6308c04497991a03c17..b01d76a24323e86e9c9cbf1cd3adc9c0d1b2c6d8 100644 (file)
@@ -628,11 +628,8 @@ static void populate_value(struct refinfo *ref)
 
        if (need_symref && (ref->flag & REF_ISSYMREF) && !ref->symref) {
                unsigned char unused1[20];
-               const char *symref;
-               symref = resolve_ref(ref->refname, unused1, 1, NULL);
-               if (symref)
-                       ref->symref = xstrdup(symref);
-               else
+               ref->symref = resolve_refdup(ref->refname, unused1, 1, NULL);
+               if (!ref->symref)
                        ref->symref = "";
        }