Skip to content

Commit 80bc042

Browse files
benknoblegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1ee85f0 commit 80bc042

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

t/t3903-stash.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,7 @@ test_expect_success 'branch: should not drop the stash if the apply fails' '
895895

896896
test_expect_success 'apply: show same status as git status (relative to ./)' '
897897
git stash clear &&
898+
mkdir -p subdir &&
898899
echo 1 >subdir/subfile1 &&
899900
echo 2 >subdir/subfile2 &&
900901
git add subdir/subfile1 &&
@@ -1327,6 +1328,7 @@ test_expect_success 'stash -k -- <pathspec> leaves unstaged files intact' '
13271328

13281329
test_expect_success 'stash -- <subdir> leaves untracked files in subdir intact' '
13291330
git reset &&
1331+
mkdir -p subdir &&
13301332
>subdir/untracked &&
13311333
>subdir/tracked1 &&
13321334
>subdir/tracked2 &&
@@ -1343,6 +1345,7 @@ test_expect_success 'stash -- <subdir> leaves untracked files in subdir intact'
13431345

13441346
test_expect_success 'stash -- <subdir> works with binary files' '
13451347
git reset &&
1348+
mkdir -p subdir &&
13461349
>subdir/untracked &&
13471350
>subdir/tracked &&
13481351
cp "$TEST_DIRECTORY"/test-binary-1.png subdir/tracked-binary &&

0 commit comments

Comments
 (0)