From: randall.s.becker@rogers.com Date: Sun, 17 Feb 2019 16:34:56 GMT Subject: [Fix v1] builtin/ls-files.c: add error check on lstat for modified files Message-ID: <20190217163456.17560-1-randall.s.becker@rogers.com> From: "Randall S. Becker" The result from lstat, checking whether a file has been deleted, is now included priot to calling id_modified when showing modified files. Prior to this fix, it is possible that files that were deleted could show up as being modified because the lstat error was unchecked. Reported-by: Joe Ranieri Signed-off-by: Randall S. Becker --- builtin/ls-files.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/ls-files.c b/builtin/ls-files.c index 29a8762d4..fc21f4795 100644 --- a/builtin/ls-files.c +++ b/builtin/ls-files.c @@ -348,7 +348,7 @@ static void show_files(struct repository *repo, struct dir_struct *dir) err = lstat(fullname.buf, &st); if (show_deleted && err) show_ce(repo, dir, ce, fullname.buf, tag_removed); - if (show_modified && ie_modified(repo->index, ce, &st, 0)) + if (show_modified && !err && ie_modified(repo->index, ce, &st, 0)) show_ce(repo, dir, ce, fullname.buf, tag_modified); } } -- 2.12.3