@matheusbsbs / matheus-bagliano / commits / ceff079bdc
Fork 0

Make sure git-stash works from subdirectory.

We say "SUBDIRECTORY_OK" but we did not chdir to toplevel; this is fine as long as everything we use can be started from a subdirectory, but unfortunately "merge-recursive" is not one of the programs you can safely use from a subdirectory. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Jul 25, 2007 at 15:32 UTC ceff079bdcaebb67b0379a1036a32b4dfebb6012
2 files changed +8
git-stash.sh
+1
@@ -6,6 +6,7 @@ USAGE='[ | list | show | apply | clear]'
6 SUBDIRECTORY_OK=Yes
7 . git-sh-setup
8 require_work_tree
9 +cd_to_toplevel
10
11 TMP="$GIT_DIR/.git-stash.$$"
12 trap 'rm -f "$TMP-*"' 0
t/t3903-stash.sh
+7
@@ -66,4 +66,11 @@ test_expect_success 'apply stashed changes (including index)' '
66 test 1 = $(git show HEAD:file)
67 '
68
69 +test_expect_success 'unstashing in a subdirectory' '
70 + git reset --hard HEAD &&
71 + mkdir subdir &&
72 + cd subdir &&
73 + git stash apply
74 +'
75 +
76 test_done