Skip to content

Commit 80f5edb

Browse files
chore: tweak a few more global git settings (#690)
* chore: tweak a few more global git settings * ci: update git global config for Windows --------- Co-authored-by: David Sanders <[email protected]>
1 parent fe85de3 commit 80f5edb

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

.github/workflows/test.yml

+2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
git config --global core.autocrlf false
3030
git config --global core.eol lf
3131
git config --global core.filemode false
32+
git config --global core.fscache true
33+
git config --global core.preloadindex true
3234
git config --global branch.autosetuprebase always
3335
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # tag: v4.2.2
3436
with:

src/utils/git.js

+14
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@ function checkGlobalGitConfig() {
3434
spawnSyncWithLog('git', ['config', '--global', 'branch.autosetuprebase', 'always']);
3535
}, new Error('git config --global branch.autosetuprebase must be set to always.'));
3636
}
37+
38+
const { stdout: fscache } = cp.spawnSync('git', ['config', '--global', 'core.fscache']);
39+
if (fscache.toString().trim() !== 'true') {
40+
maybeAutoFix(() => {
41+
spawnSyncWithLog('git', ['config', '--global', 'core.fscache', 'true']);
42+
}, new Error('git config --global core.fscache should be set to true.'));
43+
}
44+
45+
const { stdout: preloadIndex } = cp.spawnSync('git', ['config', '--global', 'core.preloadindex']);
46+
if (preloadIndex.toString().trim() !== 'true') {
47+
maybeAutoFix(() => {
48+
spawnSyncWithLog('git', ['config', '--global', 'core.preloadindex', 'true']);
49+
}, new Error('git config --global core.preloadindex should be set to true.'));
50+
}
3751
}
3852

3953
module.exports = {

0 commit comments

Comments
 (0)