diff options
-rw-r--r-- | unpack-trees.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/unpack-trees.c b/unpack-trees.c index d5a453079..3011d9b90 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -1197,12 +1197,16 @@ static int verify_absent_1(struct cache_entry *ce, return check_ok_to_remove(path, len, DT_UNKNOWN, NULL, &st, error_type, o); - } else if (!lstat(ce->name, &st)) + } else if (lstat(ce->name, &st)) { + if (errno != ENOENT) + return error("cannot stat '%s': %s", ce->name, + strerror(errno)); + return 0; + } else { return check_ok_to_remove(ce->name, ce_namelen(ce), - ce_to_dtype(ce), ce, &st, - error_type, o); - - return 0; + ce_to_dtype(ce), ce, &st, + error_type, o); + } } static int verify_absent(struct cache_entry *ce, |