]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin-for-each-ref.c
Makefile: use /usr/ucb/install on SunOS platforms rather than ginstall
[thirdparty/git.git] / builtin-for-each-ref.c
index c8114c8afdb5e5d8a5f0adac2302aa97c384d232..d091e04af9549b70a1e15a4b845383056e71932e 100644 (file)
@@ -339,8 +339,11 @@ static const char *copy_name(const char *buf)
 static const char *copy_email(const char *buf)
 {
        const char *email = strchr(buf, '<');
-       const char *eoemail = strchr(email, '>');
-       if (!email || !eoemail)
+       const char *eoemail;
+       if (!email)
+               return "";
+       eoemail = strchr(email, '>');
+       if (!eoemail)
                return "";
        return xmemdupz(email, eoemail + 1 - email);
 }
@@ -601,7 +604,8 @@ static void populate_value(struct refinfo *ref)
                if (formatp) {
                        formatp++;
                        if (!strcmp(formatp, "short"))
-                               refname = shorten_unambiguous_ref(refname);
+                               refname = shorten_unambiguous_ref(refname,
+                                                     warn_ambiguous_refs);
                        else
                                die("unknown %.*s format %s",
                                    (int)(formatp - name), name, formatp);
@@ -917,6 +921,9 @@ int cmd_for_each_ref(int argc, const char **argv, const char *prefix)
                sort = default_sort();
        sort_atom_limit = used_atom_cnt;
 
+       /* for warn_ambiguous_refs */
+       git_config(git_default_config, NULL);
+
        memset(&cbdata, 0, sizeof(cbdata));
        cbdata.grab_pattern = argv;
        for_each_ref(grab_single_ref, &cbdata);