Skip to content

Commit 9ce472a

Browse files
committed
chore: tweak a few more global git settings
1 parent acf4208 commit 9ce472a

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

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)