builtin/worktree.c: use error_errno()

While at there, improve the error message to say _what_ failed to
remove.

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:34 +07:00 committed by Junio C Hamano
parent 17bef17ef8
commit 8d19e93094

View file

@ -109,7 +109,7 @@ static void prune_worktrees(void)
if (ret < 0 && errno == ENOTDIR)
ret = unlink(path.buf);
if (ret)
error(_("failed to remove: %s"), strerror(errno));
error_errno(_("failed to remove '%s'"), path.buf);
}
closedir(dir);
if (!show_only)