author | Junio C Hamano <gitster@pobox.com> | |
Mon, 21 Mar 2011 17:18:19 +0000 (10:18 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 21 Mar 2011 21:49:46 +0000 (14:49 -0700) | ||
commit | 483fbe2b7cb89ddcf700a677735d21aa176bc5a6 | |
tree | 196797d11b877f00132abd9480ab5002727a0fea | tree | snapshot |
parent | ccdc4ec3044bd108ae1e20d772f078c10df114b3 | commit | diff |
update $GIT_INDEX_FILE when there are racily clean entries
Traditional "opportunistic index update" done by read-only "diff" and
"status" was about updating cached lstat(2) information in the index for
the next round. We missed another obvious optimization opportunity: when
there are racily clean entries that will cease to be racily clean by
updating $GIT_INDEX_FILE. Detect that case and write $GIT_INDEX_FILE out
to give it a newer timestamp.
Noticed by Lasse Makholm by stracing "git status" in a fresh checkout and
counting the number of open(2) calls.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Traditional "opportunistic index update" done by read-only "diff" and
"status" was about updating cached lstat(2) information in the index for
the next round. We missed another obvious optimization opportunity: when
there are racily clean entries that will cease to be racily clean by
updating $GIT_INDEX_FILE. Detect that case and write $GIT_INDEX_FILE out
to give it a newer timestamp.
Noticed by Lasse Makholm by stracing "git status" in a fresh checkout and
counting the number of open(2) calls.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
read-cache.c | diff | blob | history |