1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-19 15:16:08 +02: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:
Nguyễn Thái Ngọc Duy 2016-05-08 16:47:58 +07:00 committed by Junio C Hamano
parent 1fee1dce71
commit 43c728e2c2

View File

@ -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),