for-each-ref: report broken references correctly
[gitweb.git] / builtin / for-each-ref.c
index 008513c2f135b5a77d1642ff88e272a7e2f9f9d5..4a15f568f116fe797d257274ce0782be9e4e8aeb 100644 (file)
@@ -851,6 +851,11 @@ static int grab_single_ref(const char *refname, const unsigned char *sha1, int f
                  return 0;
        }
 
+       if (flag & REF_ISBROKEN) {
+                 warning("ignoring broken ref %s", refname);
+                 return 0;
+       }
+
        if (*cb->grab_pattern) {
                const char **pattern;
                int namelen = strlen(refname);