diff options
Diffstat (limited to 'reachable.c')
-rw-r--r-- | reachable.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/reachable.c b/reachable.c index a647267ae9..43616d49c7 100644 --- a/reachable.c +++ b/reachable.c @@ -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; @@ -142,10 +149,12 @@ int add_unseen_recent_objects_to_traversal(struct rev_info *revs, data.revs = revs; data.timestamp = timestamp; - r = for_each_loose_object(add_recent_loose, &data); + r = for_each_loose_object(add_recent_loose, &data, + FOR_EACH_OBJECT_LOCAL_ONLY); if (r) return r; - return for_each_packed_object(add_recent_packed, &data); + return for_each_packed_object(add_recent_packed, &data, + FOR_EACH_OBJECT_LOCAL_ONLY); } void mark_reachable_objects(struct rev_info *revs, int mark_reflog, |