{"thread":{"id":"56460","subject":"[PATCH] tests: remove leftover untracked files","startedAt":"2021-09-08T04:47:59Z","lastAt":"2021-09-11T17:08:46Z","messageCount":4,"participants":["Elijah Newren via GitGitGadget","Johannes Schindelin","Derrick Stolee"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"435019","messageId":"pull.1088.git.git.1631076472457.gitgitgadget@gmail.com","threadId":"56460","inReplyTo":null,"subject":"[PATCH] tests: remove leftover untracked files","fromName":"Elijah Newren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-09-08T04:47:52Z","receivedAt":"2021-09-08T04:47:59Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"From: Elijah Newren <newren@gmail.com>\n\nRemove untracked files that are unwanted after they are done being used.\n\nWhile the set of cases in this patch is certainly far from\ncomprehensive, it was motivated by some work to see what the fallout\nwould be if we were to make the removal of untracked files as a side\neffect of other commands into an error.  Some cases were a bit more\ninvolved than the testcase changes included in this patch, but the ones\nincluded here represent the simple cases.  While this patch is not that\nimportant since we are not changing the behavior of those other commands\ninto an error in the near term, I thought these changes were useful\nanyway as an explicit documentation of the intent that these untracked\nfiles are no longer useful.\n\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n    tests: remove leftover untracked files\n    \n    Remove untracked files that are unwanted after they are done being used.\n    \n    While the set of cases in this patch is certainly far from\n    comprehensive, it was motivated by some work to see what the fallout\n    would be if we were to make the removal of untracked files as a side\n    effect of other commands into an error. Some cases were a bit more\n    involved than the testcase changes included in this patch, but the ones\n    included here represent the simple cases. While this patch is not that\n    important since we are not changing the behavior of those other commands\n    into an error in the near term, I thought these changes were useful\n    anyway as an explicit documentation of the intent that these untracked\n    files are no longer useful.\n    \n    Signed-off-by: Elijah Newren newren@gmail.com\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1088%2Fnewren%2Fremove-leftover-test-crud-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1088/newren/remove-leftover-test-crud-v1\nPull-Request: https://github.com/git/git/pull/1088\n\n t/t0090-cache-tree.sh                    | 1 +\n t/t2021-checkout-overwrite.sh            | 1 +\n t/t3404-rebase-interactive.sh            | 1 +\n t/t3435-rebase-gpg-sign.sh               | 1 +\n t/t3510-cherry-pick-sequence.sh          | 1 +\n t/t5304-prune.sh                         | 1 +\n t/t6415-merge-dir-to-symlink.sh          | 6 ++++--\n t/t6424-merge-unrelated-index-changes.sh | 1 +\n t/t6430-merge-recursive.sh               | 4 +++-\n t/t6436-merge-overwrite.sh               | 3 ++-\n t/t7201-co.sh                            | 1 +\n t/t7600-merge.sh                         | 1 +\n 12 files changed, 18 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t0090-cache-tree.sh b/t/t0090-cache-tree.sh\nindex 9bf66c9e68d..90675726484 100755\n--- a/t/t0090-cache-tree.sh\n+++ b/t/t0090-cache-tree.sh\n@@ -195,6 +195,7 @@ test_expect_success 'reset --hard gives cache-tree' '\n \n test_expect_success 'reset --hard without index gives cache-tree' '\n \trm -f .git/index &&\n+\tgit clean -fd &&\n \tgit reset --hard &&\n \ttest_cache_tree\n '\ndiff --git a/t/t2021-checkout-overwrite.sh b/t/t2021-checkout-overwrite.sh\nindex 70d69263e68..660132ff8d5 100755\n--- a/t/t2021-checkout-overwrite.sh\n+++ b/t/t2021-checkout-overwrite.sh\n@@ -48,6 +48,7 @@ test_expect_success 'checkout commit with dir must not remove untracked a/b' '\n \n test_expect_success SYMLINKS 'the symlink remained' '\n \n+\ttest_when_finished \"rm a/b\" &&\n \ttest -h a/b\n '\n \ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex d877872e8f4..972ce026bbc 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -297,6 +297,7 @@ test_expect_success 'abort with error when new base cannot be checked out' '\n \t\toutput &&\n \ttest_i18ngrep \"file1\" output &&\n \ttest_path_is_missing .git/rebase-merge &&\n+\trm file1 &&\n \tgit reset --hard HEAD^\n '\n \ndiff --git a/t/t3435-rebase-gpg-sign.sh b/t/t3435-rebase-gpg-sign.sh\nindex ec107668580..5f8ba2c7399 100755\n--- a/t/t3435-rebase-gpg-sign.sh\n+++ b/t/t3435-rebase-gpg-sign.sh\n@@ -65,6 +65,7 @@ test_rebase_gpg_sign ! true  -i --gpg-sign --no-gpg-sign\n test_rebase_gpg_sign   false -i --no-gpg-sign --gpg-sign\n \n test_expect_failure 'rebase -p --no-gpg-sign override commit.gpgsign' '\n+\ttest_when_finished \"git clean -f\" &&\n \tgit reset --hard merged &&\n \tgit config commit.gpgsign true &&\n \tgit rebase -p --no-gpg-sign --onto=one fork-point main &&\ndiff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh\nindex 49010aa9469..3b0fa66c33d 100755\n--- a/t/t3510-cherry-pick-sequence.sh\n+++ b/t/t3510-cherry-pick-sequence.sh\n@@ -238,6 +238,7 @@ test_expect_success 'allow skipping commit but not abort for a new history' '\n '\n \n test_expect_success 'allow skipping stopped cherry-pick because of untracked file modifications' '\n+\ttest_when_finished \"rm unrelated\" &&\n \tpristine_detach initial &&\n \tgit rm --cached unrelated &&\n \tgit commit -m \"untrack unrelated\" &&\ndiff --git a/t/t5304-prune.sh b/t/t5304-prune.sh\nindex 7cabb85ca6e..8ae314af585 100755\n--- a/t/t5304-prune.sh\n+++ b/t/t5304-prune.sh\n@@ -291,6 +291,7 @@ test_expect_success 'prune: handle HEAD reflog in multiple worktrees' '\n \t\tcat ../expected >blob &&\n \t\tgit add blob &&\n \t\tgit commit -m \"second commit in third\" &&\n+\t\tgit clean -f && # Remove untracked left behind by deleting index\n \t\tgit reset --hard HEAD^\n \t) &&\n \tgit prune --expire=now &&\ndiff --git a/t/t6415-merge-dir-to-symlink.sh b/t/t6415-merge-dir-to-symlink.sh\nindex 2ce104aca7c..2655e295f5a 100755\n--- a/t/t6415-merge-dir-to-symlink.sh\n+++ b/t/t6415-merge-dir-to-symlink.sh\n@@ -25,7 +25,8 @@ test_expect_success 'checkout does not clobber untracked symlink' '\n \tgit reset --hard main &&\n \tgit rm --cached a/b &&\n \tgit commit -m \"untracked symlink remains\" &&\n-\ttest_must_fail git checkout start^0\n+\ttest_must_fail git checkout start^0 &&\n+\tgit clean -fd    # Do not leave the untracked symlink in the way\n '\n \n test_expect_success 'a/b-2/c/d is kept when clobbering symlink b' '\n@@ -34,7 +35,8 @@ test_expect_success 'a/b-2/c/d is kept when clobbering symlink b' '\n \tgit rm --cached a/b &&\n \tgit commit -m \"untracked symlink remains\" &&\n \tgit checkout -f start^0 &&\n-\ttest_path_is_file a/b-2/c/d\n+\ttest_path_is_file a/b-2/c/d &&\n+\tgit clean -fd    # Do not leave the untracked symlink in the way\n '\n \n test_expect_success 'checkout should not have deleted a/b-2/c/d' '\ndiff --git a/t/t6424-merge-unrelated-index-changes.sh b/t/t6424-merge-unrelated-index-changes.sh\nindex 5e3779ebc93..89dd544f388 100755\n--- a/t/t6424-merge-unrelated-index-changes.sh\n+++ b/t/t6424-merge-unrelated-index-changes.sh\n@@ -132,6 +132,7 @@ test_expect_success 'merge-recursive, when index==head but head!=HEAD' '\n \n \t# Make index match B\n \tgit diff C B -- | git apply --cached &&\n+\ttest_when_finished \"git clean -fd\" &&  # Do not leave untracked around\n \t# Merge B & F, with B as \"head\"\n \tgit merge-recursive A -- B F > out &&\n \ttest_i18ngrep \"Already up to date\" out\ndiff --git a/t/t6430-merge-recursive.sh b/t/t6430-merge-recursive.sh\nindex ffcc01fe65d..a0efe7cb6db 100755\n--- a/t/t6430-merge-recursive.sh\n+++ b/t/t6430-merge-recursive.sh\n@@ -718,7 +718,9 @@ test_expect_success 'merge-recursive remembers the names of all base trees' '\n \t# merge-recursive prints in reverse order, but we do not care\n \tsort <trees >expect &&\n \tsed -n \"s/^virtual //p\" out | sort >actual &&\n-\ttest_cmp expect actual\n+\ttest_cmp expect actual &&\n+\n+\tgit clean -fd\n '\n \n test_expect_success 'merge-recursive internal merge resolves to the sameness' '\ndiff --git a/t/t6436-merge-overwrite.sh b/t/t6436-merge-overwrite.sh\nindex 84b4aacf496..c0b7bd7c3fe 100755\n--- a/t/t6436-merge-overwrite.sh\n+++ b/t/t6436-merge-overwrite.sh\n@@ -68,7 +68,8 @@ test_expect_success 'will not overwrite removed file' '\n \tgit commit -m \"rm c1.c\" &&\n \tcp important c1.c &&\n \ttest_must_fail git merge c1a &&\n-\ttest_cmp important c1.c\n+\ttest_cmp important c1.c &&\n+\trm c1.c  # Do not leave untracked file in way of future tests\n '\n \n test_expect_success 'will not overwrite re-added file' '\ndiff --git a/t/t7201-co.sh b/t/t7201-co.sh\nindex 7f6e23a4bb9..b7ba1c3268e 100755\n--- a/t/t7201-co.sh\n+++ b/t/t7201-co.sh\n@@ -585,6 +585,7 @@ test_expect_success 'checkout --conflict=diff3' '\n '\n \n test_expect_success 'failing checkout -b should not break working tree' '\n+\tgit clean -fd &&  # Remove untracked files in the way\n \tgit reset --hard main &&\n \tgit symbolic-ref HEAD refs/heads/main &&\n \ttest_must_fail git checkout -b renamer side^ &&\ndiff --git a/t/t7600-merge.sh b/t/t7600-merge.sh\nindex 2ef39d3088e..c773e30b3fa 100755\n--- a/t/t7600-merge.sh\n+++ b/t/t7600-merge.sh\n@@ -717,6 +717,7 @@ test_expect_success 'failed fast-forward merge with --autostash' '\n \tgit reset --hard c0 &&\n \tgit merge-file file file.orig file.5 &&\n \tcp file.5 other &&\n+\ttest_when_finished \"rm other\" &&\n \ttest_must_fail git merge --autostash c1 2>err &&\n \ttest_i18ngrep \"Applied autostash.\" err &&\n \ttest_cmp file.5 file\n\nbase-commit: e0a2f5cbc585657e757385ad918f167f519cfb96\n-- \ngitgitgadget\n"},{"id":"435038","messageId":"nycvar.QRO.7.76.6.2109080950540.55@tvgsbejvaqbjf.bet","threadId":"56460","inReplyTo":"pull.1088.git.git.1631076472457.gitgitgadget@gmail.com","subject":"Re: [PATCH] tests: remove leftover untracked files","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2021-09-08T07:53:18Z","receivedAt":"2021-09-08T07:53:13Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Elijah,\n\nOn Wed, 8 Sep 2021, Elijah Newren via GitGitGadget wrote:\n\n> From: Elijah Newren <newren@gmail.com>\n>\n> Remove untracked files that are unwanted after they are done being used.\n>\n> While the set of cases in this patch is certainly far from\n> comprehensive, it was motivated by some work to see what the fallout\n> would be if we were to make the removal of untracked files as a side\n> effect of other commands into an error.  Some cases were a bit more\n> involved than the testcase changes included in this patch, but the ones\n> included here represent the simple cases.  While this patch is not that\n> important since we are not changing the behavior of those other commands\n> into an error in the near term, I thought these changes were useful\n> anyway as an explicit documentation of the intent that these untracked\n> files are no longer useful.\n\nWhile I find it a bit distracting when things are getting fixed that are\nnot exactly broken (there is enough that is broken and needs to be\nfixed!), at least this patch is not disruptive and since you already did\nthe work, I am in favor of integrating the patch.\n\nThanks,\nDscho\n"},{"id":"435080","messageId":"10725c54-9831-1f44-e5fb-9971374c264e@gmail.com","threadId":"56460","inReplyTo":"pull.1088.git.git.1631076472457.gitgitgadget@gmail.com","subject":"Re: [PATCH] tests: remove leftover untracked files","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2021-09-08T13:11:51Z","receivedAt":"2021-09-08T13:11:56Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 9/8/2021 12:47 AM, Elijah Newren via GitGitGadget wrote:\n> From: Elijah Newren <newren@gmail.com>\n> \n> Remove untracked files that are unwanted after they are done being used.\n> \n> While the set of cases in this patch is certainly far from\n> comprehensive, it was motivated by some work to see what the fallout\n> would be if we were to make the removal of untracked files as a side\n> effect of other commands into an error.  Some cases were a bit more\n> involved than the testcase changes included in this patch, but the ones\n> included here represent the simple cases.  While this patch is not that\n> important since we are not changing the behavior of those other commands\n> into an error in the near term, I thought these changes were useful\n> anyway as an explicit documentation of the intent that these untracked\n> files are no longer useful.\n\nI think your stated goal is a good one. These minor test edits are\ngood to fit in while they are not conflicting with any other work\nin flight. As long as it is easy to fit in with other ongoing topics,\nthen this should be taken and merged quickly.\n\nThanks,\n-Stolee\n"},{"id":"435575","messageId":"pull.1088.v2.git.git.1631380122593.gitgitgadget@gmail.com","threadId":"56460","inReplyTo":"pull.1088.git.git.1631076472457.gitgitgadget@gmail.com","subject":"[PATCH v2] tests: remove leftover untracked files","fromName":"Elijah Newren via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2021-09-11T17:08:42Z","receivedAt":"2021-09-11T17:08:46Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"From: Elijah Newren <newren@gmail.com>\n\nRemove untracked files that are unwanted after they are done being used.\n\nWhile the set of cases in this patch is certainly far from\ncomprehensive, it was motivated by some work to see what the fallout\nwould be if we were to make the removal of untracked files as a side\neffect of other commands into an error.  Some cases were a bit more\ninvolved than the testcase changes included in this patch, but the ones\nincluded here represent the simple cases.  While this patch is not that\nimportant since we are not changing the behavior of those other commands\ninto an error in the near term, I thought these changes were useful\nanyway as an explicit documentation of the intent that these untracked\nfiles are no longer useful.\n\nAcked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\nAcked-by: Derrick Stolee <stolee@gmail.com>\nSigned-off-by: Elijah Newren <newren@gmail.com>\n---\n    tests: remove leftover untracked files\n    \n    Changes since v1:\n    \n     * Added Acked-by's from Stolee and Dscho\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1088%2Fnewren%2Fremove-leftover-test-crud-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1088/newren/remove-leftover-test-crud-v2\nPull-Request: https://github.com/git/git/pull/1088\n\nRange-diff vs v1:\n\n 1:  85d326a52d9 ! 1:  8812157be16 tests: remove leftover untracked files\n     @@ Commit message\n          anyway as an explicit documentation of the intent that these untracked\n          files are no longer useful.\n      \n     +    Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>\n     +    Acked-by: Derrick Stolee <stolee@gmail.com>\n          Signed-off-by: Elijah Newren <newren@gmail.com>\n      \n       ## t/t0090-cache-tree.sh ##\n\n\n t/t0090-cache-tree.sh                    | 1 +\n t/t2021-checkout-overwrite.sh            | 1 +\n t/t3404-rebase-interactive.sh            | 1 +\n t/t3435-rebase-gpg-sign.sh               | 1 +\n t/t3510-cherry-pick-sequence.sh          | 1 +\n t/t5304-prune.sh                         | 1 +\n t/t6415-merge-dir-to-symlink.sh          | 6 ++++--\n t/t6424-merge-unrelated-index-changes.sh | 1 +\n t/t6430-merge-recursive.sh               | 4 +++-\n t/t6436-merge-overwrite.sh               | 3 ++-\n t/t7201-co.sh                            | 1 +\n t/t7600-merge.sh                         | 1 +\n 12 files changed, 18 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t0090-cache-tree.sh b/t/t0090-cache-tree.sh\nindex 9bf66c9e68d..90675726484 100755\n--- a/t/t0090-cache-tree.sh\n+++ b/t/t0090-cache-tree.sh\n@@ -195,6 +195,7 @@ test_expect_success 'reset --hard gives cache-tree' '\n \n test_expect_success 'reset --hard without index gives cache-tree' '\n \trm -f .git/index &&\n+\tgit clean -fd &&\n \tgit reset --hard &&\n \ttest_cache_tree\n '\ndiff --git a/t/t2021-checkout-overwrite.sh b/t/t2021-checkout-overwrite.sh\nindex 70d69263e68..660132ff8d5 100755\n--- a/t/t2021-checkout-overwrite.sh\n+++ b/t/t2021-checkout-overwrite.sh\n@@ -48,6 +48,7 @@ test_expect_success 'checkout commit with dir must not remove untracked a/b' '\n \n test_expect_success SYMLINKS 'the symlink remained' '\n \n+\ttest_when_finished \"rm a/b\" &&\n \ttest -h a/b\n '\n \ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex d877872e8f4..972ce026bbc 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -297,6 +297,7 @@ test_expect_success 'abort with error when new base cannot be checked out' '\n \t\toutput &&\n \ttest_i18ngrep \"file1\" output &&\n \ttest_path_is_missing .git/rebase-merge &&\n+\trm file1 &&\n \tgit reset --hard HEAD^\n '\n \ndiff --git a/t/t3435-rebase-gpg-sign.sh b/t/t3435-rebase-gpg-sign.sh\nindex ec107668580..5f8ba2c7399 100755\n--- a/t/t3435-rebase-gpg-sign.sh\n+++ b/t/t3435-rebase-gpg-sign.sh\n@@ -65,6 +65,7 @@ test_rebase_gpg_sign ! true  -i --gpg-sign --no-gpg-sign\n test_rebase_gpg_sign   false -i --no-gpg-sign --gpg-sign\n \n test_expect_failure 'rebase -p --no-gpg-sign override commit.gpgsign' '\n+\ttest_when_finished \"git clean -f\" &&\n \tgit reset --hard merged &&\n \tgit config commit.gpgsign true &&\n \tgit rebase -p --no-gpg-sign --onto=one fork-point main &&\ndiff --git a/t/t3510-cherry-pick-sequence.sh b/t/t3510-cherry-pick-sequence.sh\nindex 49010aa9469..3b0fa66c33d 100755\n--- a/t/t3510-cherry-pick-sequence.sh\n+++ b/t/t3510-cherry-pick-sequence.sh\n@@ -238,6 +238,7 @@ test_expect_success 'allow skipping commit but not abort for a new history' '\n '\n \n test_expect_success 'allow skipping stopped cherry-pick because of untracked file modifications' '\n+\ttest_when_finished \"rm unrelated\" &&\n \tpristine_detach initial &&\n \tgit rm --cached unrelated &&\n \tgit commit -m \"untrack unrelated\" &&\ndiff --git a/t/t5304-prune.sh b/t/t5304-prune.sh\nindex 7cabb85ca6e..8ae314af585 100755\n--- a/t/t5304-prune.sh\n+++ b/t/t5304-prune.sh\n@@ -291,6 +291,7 @@ test_expect_success 'prune: handle HEAD reflog in multiple worktrees' '\n \t\tcat ../expected >blob &&\n \t\tgit add blob &&\n \t\tgit commit -m \"second commit in third\" &&\n+\t\tgit clean -f && # Remove untracked left behind by deleting index\n \t\tgit reset --hard HEAD^\n \t) &&\n \tgit prune --expire=now &&\ndiff --git a/t/t6415-merge-dir-to-symlink.sh b/t/t6415-merge-dir-to-symlink.sh\nindex 2ce104aca7c..2655e295f5a 100755\n--- a/t/t6415-merge-dir-to-symlink.sh\n+++ b/t/t6415-merge-dir-to-symlink.sh\n@@ -25,7 +25,8 @@ test_expect_success 'checkout does not clobber untracked symlink' '\n \tgit reset --hard main &&\n \tgit rm --cached a/b &&\n \tgit commit -m \"untracked symlink remains\" &&\n-\ttest_must_fail git checkout start^0\n+\ttest_must_fail git checkout start^0 &&\n+\tgit clean -fd    # Do not leave the untracked symlink in the way\n '\n \n test_expect_success 'a/b-2/c/d is kept when clobbering symlink b' '\n@@ -34,7 +35,8 @@ test_expect_success 'a/b-2/c/d is kept when clobbering symlink b' '\n \tgit rm --cached a/b &&\n \tgit commit -m \"untracked symlink remains\" &&\n \tgit checkout -f start^0 &&\n-\ttest_path_is_file a/b-2/c/d\n+\ttest_path_is_file a/b-2/c/d &&\n+\tgit clean -fd    # Do not leave the untracked symlink in the way\n '\n \n test_expect_success 'checkout should not have deleted a/b-2/c/d' '\ndiff --git a/t/t6424-merge-unrelated-index-changes.sh b/t/t6424-merge-unrelated-index-changes.sh\nindex 5e3779ebc93..89dd544f388 100755\n--- a/t/t6424-merge-unrelated-index-changes.sh\n+++ b/t/t6424-merge-unrelated-index-changes.sh\n@@ -132,6 +132,7 @@ test_expect_success 'merge-recursive, when index==head but head!=HEAD' '\n \n \t# Make index match B\n \tgit diff C B -- | git apply --cached &&\n+\ttest_when_finished \"git clean -fd\" &&  # Do not leave untracked around\n \t# Merge B & F, with B as \"head\"\n \tgit merge-recursive A -- B F > out &&\n \ttest_i18ngrep \"Already up to date\" out\ndiff --git a/t/t6430-merge-recursive.sh b/t/t6430-merge-recursive.sh\nindex ffcc01fe65d..a0efe7cb6db 100755\n--- a/t/t6430-merge-recursive.sh\n+++ b/t/t6430-merge-recursive.sh\n@@ -718,7 +718,9 @@ test_expect_success 'merge-recursive remembers the names of all base trees' '\n \t# merge-recursive prints in reverse order, but we do not care\n \tsort <trees >expect &&\n \tsed -n \"s/^virtual //p\" out | sort >actual &&\n-\ttest_cmp expect actual\n+\ttest_cmp expect actual &&\n+\n+\tgit clean -fd\n '\n \n test_expect_success 'merge-recursive internal merge resolves to the sameness' '\ndiff --git a/t/t6436-merge-overwrite.sh b/t/t6436-merge-overwrite.sh\nindex 84b4aacf496..c0b7bd7c3fe 100755\n--- a/t/t6436-merge-overwrite.sh\n+++ b/t/t6436-merge-overwrite.sh\n@@ -68,7 +68,8 @@ test_expect_success 'will not overwrite removed file' '\n \tgit commit -m \"rm c1.c\" &&\n \tcp important c1.c &&\n \ttest_must_fail git merge c1a &&\n-\ttest_cmp important c1.c\n+\ttest_cmp important c1.c &&\n+\trm c1.c  # Do not leave untracked file in way of future tests\n '\n \n test_expect_success 'will not overwrite re-added file' '\ndiff --git a/t/t7201-co.sh b/t/t7201-co.sh\nindex 7f6e23a4bb9..b7ba1c3268e 100755\n--- a/t/t7201-co.sh\n+++ b/t/t7201-co.sh\n@@ -585,6 +585,7 @@ test_expect_success 'checkout --conflict=diff3' '\n '\n \n test_expect_success 'failing checkout -b should not break working tree' '\n+\tgit clean -fd &&  # Remove untracked files in the way\n \tgit reset --hard main &&\n \tgit symbolic-ref HEAD refs/heads/main &&\n \ttest_must_fail git checkout -b renamer side^ &&\ndiff --git a/t/t7600-merge.sh b/t/t7600-merge.sh\nindex 2ef39d3088e..c773e30b3fa 100755\n--- a/t/t7600-merge.sh\n+++ b/t/t7600-merge.sh\n@@ -717,6 +717,7 @@ test_expect_success 'failed fast-forward merge with --autostash' '\n \tgit reset --hard c0 &&\n \tgit merge-file file file.orig file.5 &&\n \tcp file.5 other &&\n+\ttest_when_finished \"rm other\" &&\n \ttest_must_fail git merge --autostash c1 2>err &&\n \ttest_i18ngrep \"Applied autostash.\" err &&\n \ttest_cmp file.5 file\n\nbase-commit: e0a2f5cbc585657e757385ad918f167f519cfb96\n-- \ngitgitgadget\n"}]}