Commit 483fbe2
committed
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 <[email protected]>1 parent ccdc4ec commit 483fbe2
1 file changed
+14
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1545 | 1545 | | |
1546 | 1546 | | |
1547 | 1547 | | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
1548 | 1561 | | |
1549 | 1562 | | |
1550 | 1563 | | |
1551 | 1564 | | |
1552 | 1565 | | |
1553 | | - | |
| 1566 | + | |
1554 | 1567 | | |
1555 | 1568 | | |
1556 | 1569 | | |
| |||
0 commit comments