Merge branch 'tk/stripspace' into maint
[gitweb.git] / reachable.c
index 9cff25b490f7ec7c5535647afe017326a6984520..43616d49c7f88166d2fa2f009ca5b926d751ab0b 100644 (file)
@@ -25,9 +25,15 @@ static void update_progress(struct connectivity_progress *cp)
 static int add_one_ref(const char *path, const struct object_id *oid,
                       int flag, void *cb_data)
 {
-       struct object *object = parse_object_or_die(oid->hash, path);
        struct rev_info *revs = (struct rev_info *)cb_data;
+       struct object *object;
 
+       if ((flag & REF_ISSYMREF) && (flag & REF_ISBROKEN)) {
+               warning("symbolic ref is dangling: %s", path);
+               return 0;
+       }
+
+       object = parse_object_or_die(oid->hash, path);
        add_pending_object(revs, object, "");
 
        return 0;