2019-10-04 12:30:59 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2019 Johannes E Schindelin
|
|
|
|
#
|
|
|
|
|
|
|
|
test_description='Test git stash in a worktree'
|
|
|
|
|
2021-10-30 22:24:13 +00:00
|
|
|
TEST_PASSES_SANITIZE_LEAK=true
|
2019-10-04 12:30:59 +00:00
|
|
|
. ./test-lib.sh
|
|
|
|
|
|
|
|
test_expect_success 'setup' '
|
|
|
|
test_commit initial &&
|
|
|
|
git worktree add wt &&
|
|
|
|
test_commit -C wt in-worktree
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'apply in subdirectory' '
|
|
|
|
mkdir wt/subdir &&
|
|
|
|
(
|
|
|
|
cd wt/subdir &&
|
|
|
|
echo modified >../initial.t &&
|
|
|
|
git stash &&
|
|
|
|
git stash apply >out
|
|
|
|
) &&
|
|
|
|
grep "\.\.\/initial\.t" wt/subdir/out
|
|
|
|
'
|
|
|
|
|
|
|
|
test_done
|