test_expect_success '--no-untracked-cache removes the cache' '
git update-index --no-untracked-cache &&
test-dump-untracked-cache >../actual &&
test-tool dump-untracked-cache >../actual &&
echo "no untracked cache" >../expect-no-uc &&
test_cmp ../expect-no-uc ../actual
'
test_expect_success 'git status does not change anything' '
git status &&
test-dump-untracked-cache >../actual &&
test-tool dump-untracked-cache >../actual &&
test_cmp ../expect-no-uc ../actual
'
test_expect_success 'setting core.untrackedCache to true and using git status creates the cache' '
git config core.untrackedCache true &&
test-dump-untracked-cache >../actual &&
test-tool dump-untracked-cache >../actual &&
test_cmp ../expect-no-uc ../actual &&
git status &&
test-dump-untracked-cache >../actual &&
test-tool dump-untracked-cache >../actual &&
test_cmp ../expect-from-test-dump ../actual
'
test_expect_success 'using --no-untracked-cache does not fail when core.untrackedCache is true' '
git update-index --no-untracked-cache &&
test-dump-untracked-cache >../actual &&
test-tool dump-untracked-cache >../actual &&
test_cmp ../expect-no-uc ../actual &&
git update-index --untracked-cache &&
test-dump-untracked-cache >../actual &&
test-tool dump-untracked-cache >../actual &&
test_cmp ../expect-empty ../actual
'
test_expect_success 'setting core.untrackedCache to false and using git status removes the cache' '
git config core.untrackedCache false &&
test-dump-untracked-cache >../actual &&
test-tool dump-untracked-cache >../actual &&
test_cmp ../expect-empty ../actual &&
git status &&
test-dump-untracked-cache >../actual &&
test-tool dump-untracked-cache >../actual &&
test_cmp ../expect-no-uc ../actual
'
test_expect_success 'using --untracked-cache does not fail when core.untrackedCache is false' '
git update-index --untracked-cache &&
test-dump-untracked-cache >../actual &&
test-tool dump-untracked-cache >../actual &&
test_cmp ../expect-empty ../actual
'
test_expect_success 'setting core.untrackedCache to keep' '
git config core.untrackedCache keep &&
git update-index --untracked-cache &&
test-dump-untracked-cache >../actual &&
test-tool dump-untracked-cache >../actual &&
test_cmp ../expect-empty ../actual &&
git status &&
test-dump-untracked-cache >../actual &&
test-tool dump-untracked-cache >../actual &&
test_cmp ../expect-from-test-dump ../actual &&
git update-index --no-untracked-cache &&
test-dump-untracked-cache >../actual &&
test-tool dump-untracked-cache >../actual &&
test_cmp ../expect-no-uc ../actual &&
git update-index --force-untracked-cache &&
test-dump-untracked-cache >../actual &&
test-tool dump-untracked-cache >../actual &&
test_cmp ../expect-empty ../actual &&
git status &&
test-dump-untracked-cache >../actual &&
test-tool dump-untracked-cache >../actual &&
test_cmp ../expect-from-test-dump ../actual
'
@ -671,23 +671,23 @@ test_expect_success 'test ident field is working' '
@@ -671,23 +671,23 @@ test_expect_success 'test ident field is working' '
test_expect_success 'untracked cache survives a checkout' '
git commit --allow-empty -m empty &&
test-dump-untracked-cache >../before &&
test-tool dump-untracked-cache >../before &&
test_when_finished "git checkout master" &&
git checkout -b other_branch &&
test-dump-untracked-cache >../after &&
test-tool dump-untracked-cache >../after &&
test_cmp ../before ../after &&
test_commit test &&
test-dump-untracked-cache >../before &&
test-tool dump-untracked-cache >../before &&
git checkout master &&
test-dump-untracked-cache >../after &&
test-tool dump-untracked-cache >../after &&
test_cmp ../before ../after
'
test_expect_success 'untracked cache survives a commit' '
test-dump-untracked-cache >../before &&
test-tool dump-untracked-cache >../before &&
git add done/two &&
git commit -m commit &&
test-dump-untracked-cache >../after &&
test-tool dump-untracked-cache >../after &&
test_cmp ../before ../after
'
@ -751,7 +751,7 @@ test_expect_success '"status" after file replacement should be clean with UC=tru
@@ -751,7 +751,7 @@ test_expect_success '"status" after file replacement should be clean with UC=tru