blob: 347a89b030b68dc87ecea8f40dfe9d1b0ca8db16 [file] [log] [blame]
Johannes Schindelindfd557c2019-10-04 05:30:59 -07001#!/bin/sh
2#
3# Copyright (c) 2019 Johannes E Schindelin
4#
5
6test_description='Test git stash in a worktree'
7
Ævar Arnfjörð Bjarmasond96fb142021-10-31 00:24:13 +02008TEST_PASSES_SANITIZE_LEAK=true
Johannes Schindelindfd557c2019-10-04 05:30:59 -07009. ./test-lib.sh
10
11test_expect_success 'setup' '
12 test_commit initial &&
13 git worktree add wt &&
14 test_commit -C wt in-worktree
15'
16
17test_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
28test_done