t3903: reduce dependencies on previous tests
Skipping previous tests to work through only failing tests with arguments like --run=4,122- causes some tests to fail because subdir doesn't exist yet (it is created by a previous test; typically "unstashing in a subdirectory"). Create it on demand for tests that need it, but don't fail (-p) if the directory already exists. Signed-off-by: D. Ben Knoble <ben.knoble+github@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
1ee85f0e21
commit
80bc042b47
@@ -895,6 +895,7 @@ test_expect_success 'branch: should not drop the stash if the apply fails' '
|
|||||||
|
|
||||||
test_expect_success 'apply: show same status as git status (relative to ./)' '
|
test_expect_success 'apply: show same status as git status (relative to ./)' '
|
||||||
git stash clear &&
|
git stash clear &&
|
||||||
|
mkdir -p subdir &&
|
||||||
echo 1 >subdir/subfile1 &&
|
echo 1 >subdir/subfile1 &&
|
||||||
echo 2 >subdir/subfile2 &&
|
echo 2 >subdir/subfile2 &&
|
||||||
git add subdir/subfile1 &&
|
git add subdir/subfile1 &&
|
||||||
@@ -1327,6 +1328,7 @@ test_expect_success 'stash -k -- <pathspec> leaves unstaged files intact' '
|
|||||||
|
|
||||||
test_expect_success 'stash -- <subdir> leaves untracked files in subdir intact' '
|
test_expect_success 'stash -- <subdir> leaves untracked files in subdir intact' '
|
||||||
git reset &&
|
git reset &&
|
||||||
|
mkdir -p subdir &&
|
||||||
>subdir/untracked &&
|
>subdir/untracked &&
|
||||||
>subdir/tracked1 &&
|
>subdir/tracked1 &&
|
||||||
>subdir/tracked2 &&
|
>subdir/tracked2 &&
|
||||||
@@ -1343,6 +1345,7 @@ test_expect_success 'stash -- <subdir> leaves untracked files in subdir intact'
|
|||||||
|
|
||||||
test_expect_success 'stash -- <subdir> works with binary files' '
|
test_expect_success 'stash -- <subdir> works with binary files' '
|
||||||
git reset &&
|
git reset &&
|
||||||
|
mkdir -p subdir &&
|
||||||
>subdir/untracked &&
|
>subdir/untracked &&
|
||||||
>subdir/tracked &&
|
>subdir/tracked &&
|
||||||
cp "$TEST_DIRECTORY"/test-binary-1.png subdir/tracked-binary &&
|
cp "$TEST_DIRECTORY"/test-binary-1.png subdir/tracked-binary &&
|
||||||
|
|||||||
Reference in New Issue
Block a user