t2300: run git-sh-setup in an environment that better mimics the real life
[gitweb.git] / reachable.c
index 9b0295469f562998ecffb8c8608d887c973bbce5..ed352018964ef2260f5da51239800bbcc816ad1b 100644 (file)
@@ -22,11 +22,18 @@ static void update_progress(struct connectivity_progress *cp)
                display_progress(cp->progress, cp->count);
 }
 
-static int add_one_ref(const char *path, const unsigned char *sha1, int flag, void *cb_data)
+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(sha1, 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;