summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2019-10-11 14:24:48 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-10-11 14:24:48 +0900
commit66102cfad839135b89ec7e4ccd253c8d7ce627a7 (patch)
tree4fe44505ed732e8199597c98a8ea6cbb7ab3679d /t
parentMerge branch 'rs/dedup-includes' (diff)
parentstash apply: report status correctly even in a worktree's subdirectory (diff)
downloadtgif-66102cfad839135b89ec7e4ccd253c8d7ce627a7.tar.xz
Merge branch 'js/stash-apply-in-secondary-worktree'
"git stash apply" in a subdirectory of a secondary worktree failed to access the worktree correctly, which has been corrected. * js/stash-apply-in-secondary-worktree: stash apply: report status correctly even in a worktree's subdirectory
Diffstat (limited to 't')
-rwxr-xr-xt/t3908-stash-in-worktree.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/t/t3908-stash-in-worktree.sh b/t/t3908-stash-in-worktree.sh
new file mode 100755
index 0000000000..2b2b366ef9
--- /dev/null
+++ b/t/t3908-stash-in-worktree.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# Copyright (c) 2019 Johannes E Schindelin
+#
+
+test_description='Test git stash in a worktree'
+
+. ./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