mirror of
https://github.com/git/git.git
synced 2025-04-11 09:16:34 +00:00
unpack-trees.c: use error_errno()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
1fee1dce71
commit
43c728e2c2
@ -1499,8 +1499,7 @@ static int verify_absent_1(const struct cache_entry *ce,
|
||||
|
||||
path = xmemdupz(ce->name, len);
|
||||
if (lstat(path, &st))
|
||||
ret = error("cannot stat '%s': %s", path,
|
||||
strerror(errno));
|
||||
ret = error_errno("cannot stat '%s'", path);
|
||||
else
|
||||
ret = check_ok_to_remove(path, len, DT_UNKNOWN, NULL,
|
||||
&st, error_type, o);
|
||||
@ -1508,8 +1507,7 @@ static int verify_absent_1(const struct cache_entry *ce,
|
||||
return ret;
|
||||
} else if (lstat(ce->name, &st)) {
|
||||
if (errno != ENOENT)
|
||||
return error("cannot stat '%s': %s", ce->name,
|
||||
strerror(errno));
|
||||
return error_errno("cannot stat '%s'", ce->name);
|
||||
return 0;
|
||||
} else {
|
||||
return check_ok_to_remove(ce->name, ce_namelen(ce),
|
||||
|
Loading…
x
Reference in New Issue
Block a user