diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-07-25 15:32:22 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-07-25 15:34:52 -0700 |
commit | ceff079bdcaebb67b0379a1036a32b4dfebb6012 (patch) | |
tree | 670da24ef878391367b2d350a20f9ab42593eb5d | |
parent | 4eb994733d75d40cab87e7b4736166cf33e7787a (diff) | |
download | git-ceff079bdcaebb67b0379a1036a32b4dfebb6012.tar.gz |
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>
-rwxr-xr-x | git-stash.sh | 1 | ||||
-rwxr-xr-x | t/t3903-stash.sh | 7 |
2 files changed, 8 insertions, 0 deletions
diff --git a/git-stash.sh b/git-stash.sh index de13dd1812..d9cd42d4b3 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -6,6 +6,7 @@ USAGE='[ | list | show | apply | clear]' SUBDIRECTORY_OK=Yes . git-sh-setup require_work_tree +cd_to_toplevel TMP="$GIT_DIR/.git-stash.$$" trap 'rm -f "$TMP-*"' 0 diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh index 392ac1c5c5..9a9a250d2c 100755 --- a/t/t3903-stash.sh +++ b/t/t3903-stash.sh @@ -66,4 +66,11 @@ test_expect_success 'apply stashed changes (including index)' ' test 1 = $(git show HEAD:file) ' +test_expect_success 'unstashing in a subdirectory' ' + git reset --hard HEAD && + mkdir subdir && + cd subdir && + git stash apply +' + test_done |