Skip to content

Commit f0425ae

Browse files
derrickstoleeldennington
authored andcommitted
Merge pull request microsoft#415: scalar: enable untracked cache unconditionally
No matter what I try, I cannot get the untracked cache to fail on Windows. Here are the things that are done in this pull request: 1. Scalar enables the untracked cache unconditionally via `core.untrackedCache = true`. This was previously set to `false` on Windows. 2. Set `GIT_FORCE_UNTRACKED_CACHE=1` for the Scalar functional tests. 3. Update the `core.untrackedCache` config variable to be as strong as the `GIT_FORCE_UNTRACKED_CACHE` environment variable.
2 parents 7e271b9 + 10cd05c commit f0425ae

File tree

3 files changed

+4
-17
lines changed

3 files changed

+4
-17
lines changed

.github/workflows/scalar-functional-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535

3636
env:
3737
BUILD_FRAGMENT: bin/Release/netcoreapp3.1
38+
GIT_FORCE_UNTRACKED_CACHE: 1
3839

3940
steps:
4041
- name: Check out Git's source code

contrib/scalar/scalar.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -149,23 +149,7 @@ static int set_recommended_config(int reconfigure)
149149
{ "core.FSCache", "true", 1 },
150150
{ "core.multiPackIndex", "true", 1 },
151151
{ "core.preloadIndex", "true", 1 },
152-
#ifndef WIN32
153152
{ "core.untrackedCache", "true", 1 },
154-
#else
155-
/*
156-
* Unfortunately, Scalar's Functional Tests demonstrated
157-
* that the untracked cache feature is unreliable on Windows
158-
* (which is a bummer because that platform would benefit the
159-
* most from it). For some reason, freshly created files seem
160-
* not to update the directory's `lastModified` time
161-
* immediately, but the untracked cache would need to rely on
162-
* that.
163-
*
164-
* Therefore, with a sad heart, we disable this very useful
165-
* feature on Windows.
166-
*/
167-
{ "core.untrackedCache", "false", 1 },
168-
#endif
169153
{ "core.logAllRefUpdates", "true", 1 },
170154
{ "credential.https://dev.azure.com.useHttpPath", "true", 1 },
171155
{ "credential.validate", "false", 1 }, /* GCM4W-only */

dir.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3017,7 +3017,9 @@ int read_directory(struct dir_struct *dir, struct index_state *istate,
30173017

30183018
if (force_untracked_cache < 0)
30193019
force_untracked_cache =
3020-
git_env_bool("GIT_FORCE_UNTRACKED_CACHE", 0);
3020+
git_env_bool("GIT_FORCE_UNTRACKED_CACHE", -1);
3021+
if (force_untracked_cache < 0)
3022+
force_untracked_cache = (istate->repo->settings.core_untracked_cache == UNTRACKED_CACHE_WRITE);
30213023
if (force_untracked_cache &&
30223024
dir->untracked == istate->untracked &&
30233025
(dir->untracked->dir_opened ||

0 commit comments

Comments
 (0)