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); path = xmemdupz(ce->name, len);
if (lstat(path, &st)) if (lstat(path, &st))
ret = error("cannot stat '%s': %s", path, ret = error_errno("cannot stat '%s'", path);
strerror(errno));
else else
ret = check_ok_to_remove(path, len, DT_UNKNOWN, NULL, ret = check_ok_to_remove(path, len, DT_UNKNOWN, NULL,
&st, error_type, o); &st, error_type, o);
@ -1508,8 +1507,7 @@ static int verify_absent_1(const struct cache_entry *ce,
return ret; return ret;
} else if (lstat(ce->name, &st)) { } else if (lstat(ce->name, &st)) {
if (errno != ENOENT) if (errno != ENOENT)
return error("cannot stat '%s': %s", ce->name, return error_errno("cannot stat '%s'", ce->name);
strerror(errno));
return 0; return 0;
} else { } else {
return check_ok_to_remove(ce->name, ce_namelen(ce), return check_ok_to_remove(ce->name, ce_namelen(ce),