summaryrefslogtreecommitdiff
path: root/reachable.c
diff options
context:
space:
mode:
Diffstat (limited to 'reachable.c')
-rw-r--r--reachable.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/reachable.c b/reachable.c
index 69fa6851da..4cfd0dec70 100644
--- a/reachable.c
+++ b/reachable.c
@@ -24,9 +24,15 @@ static void update_progress(struct connectivity_progress *cp)
static int add_one_ref(const char *path, const unsigned char *sha1, 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(sha1, path);
add_pending_object(revs, object, "");
return 0;