Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2021-09-11 20:08:42 +0300
committerJunio C Hamano <gitster@pobox.com>2021-09-13 02:42:40 +0300
commitf222bd34ffde9e2fb06794bb657fd9dc371261df (patch)
treeac5daf0ebc83808be18435bba3c01c9de61702c8 /t/t6415-merge-dir-to-symlink.sh
parent8b7c11b8668b4e774f81a9f0b4c30144b818f1d1 (diff)
tests: remove leftover untracked files
Remove untracked files that are unwanted after they are done being used. While the set of cases in this patch is certainly far from comprehensive, it was motivated by some work to see what the fallout would be if we were to make the removal of untracked files as a side effect of other commands into an error. Some cases were a bit more involved than the testcase changes included in this patch, but the ones included here represent the simple cases. While this patch is not that important since we are not changing the behavior of those other commands into an error in the near term, I thought these changes were useful anyway as an explicit documentation of the intent that these untracked files are no longer useful. Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Acked-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6415-merge-dir-to-symlink.sh')
-rwxr-xr-xt/t6415-merge-dir-to-symlink.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/t/t6415-merge-dir-to-symlink.sh b/t/t6415-merge-dir-to-symlink.sh
index 2ce104aca7..2655e295f5 100755
--- a/t/t6415-merge-dir-to-symlink.sh
+++ b/t/t6415-merge-dir-to-symlink.sh
@@ -25,7 +25,8 @@ test_expect_success 'checkout does not clobber untracked symlink' '
git reset --hard main &&
git rm --cached a/b &&
git commit -m "untracked symlink remains" &&
- test_must_fail git checkout start^0
+ test_must_fail git checkout start^0 &&
+ git clean -fd # Do not leave the untracked symlink in the way
'
test_expect_success 'a/b-2/c/d is kept when clobbering symlink b' '
@@ -34,7 +35,8 @@ test_expect_success 'a/b-2/c/d is kept when clobbering symlink b' '
git rm --cached a/b &&
git commit -m "untracked symlink remains" &&
git checkout -f start^0 &&
- test_path_is_file a/b-2/c/d
+ test_path_is_file a/b-2/c/d &&
+ git clean -fd # Do not leave the untracked symlink in the way
'
test_expect_success 'checkout should not have deleted a/b-2/c/d' '