diff options
Diffstat (limited to 'reachable.c')
-rw-r--r-- | reachable.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/reachable.c b/reachable.c index 9b0295469f..d0199cace4 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; @@ -112,8 +119,7 @@ static int add_recent_loose(const unsigned char *sha1, */ if (errno == ENOENT) return 0; - return error("unable to stat %s: %s", - sha1_to_hex(sha1), strerror(errno)); + return error_errno("unable to stat %s", sha1_to_hex(sha1)); } add_recent_object(sha1, st.st_mtime, data); |