fsmonitor: use fsmonitor data in `git diff`
authorAlex Vandiver <redacted>
Tue, 20 Oct 2020 13:40:58 +0000 (13:40 +0000)
committerJunio C Hamano <redacted>
Tue, 20 Oct 2020 19:52:21 +0000 (12:52 -0700)
commitc9052a8392878d9e38381db5d2172f7f8f7272a3
tree6b963049a194fe573d712e33709a17e57ecd4c70
parent430cabb104103251958ac0739509e0a542e5c774
fsmonitor: use fsmonitor data in `git diff`

With fsmonitor enabled, the first call to match_stat_with_submodule
calls refresh_fsmonitor, incurring the overhead of reading the list of
updated files -- but run_diff_files does not respect the
CE_FSMONITOR_VALID flag.

Make use of the fsmonitor extension to skip lstat() calls on files
that fsmonitor judged as unmodified.

Notably, this change improves performance of the git shell prompt when
GIT_PS1_SHOWDIRTYSTATE is set.

Signed-off-by: Alex Vandiver <redacted>
Signed-off-by: Nipunn Koorapati <redacted>
Signed-off-by: Junio C Hamano <redacted>
diff-lib.c
git clone https://git.99rst.org/PROJECT