Johannes Schindelin | dfd557c | 2019-10-04 05:30:59 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # Copyright (c) 2019 Johannes E Schindelin |
| 4 | # |
| 5 | |
| 6 | test_description='Test git stash in a worktree' |
| 7 | |
Ævar Arnfjörð Bjarmason | d96fb14 | 2021-10-31 00:24:13 +0200 | [diff] [blame] | 8 | TEST_PASSES_SANITIZE_LEAK=true |
Johannes Schindelin | dfd557c | 2019-10-04 05:30:59 -0700 | [diff] [blame] | 9 | . ./test-lib.sh |
| 10 | |
| 11 | test_expect_success 'setup' ' |
| 12 | test_commit initial && |
| 13 | git worktree add wt && |
| 14 | test_commit -C wt in-worktree |
| 15 | ' |
| 16 | |
| 17 | test_expect_success 'apply in subdirectory' ' |
| 18 | mkdir wt/subdir && |
| 19 | ( |
| 20 | cd wt/subdir && |
| 21 | echo modified >../initial.t && |
| 22 | git stash && |
| 23 | git stash apply >out |
| 24 | ) && |
| 25 | grep "\.\.\/initial\.t" wt/subdir/out |
| 26 | ' |
| 27 | |
| 28 | test_done |