Skip to content

Commit

Permalink
Add test: git stash shows status relative to current dir
Browse files Browse the repository at this point in the history
[jc: moved "cd subdir" inside subshell and fixed comparison with expected]

Signed-off-by: Piotr Krukowiecki <piotr.krukowiecki@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Piotr Krukowiecki authored and Junio C Hamano committed Mar 21, 2011
1 parent 26b59b4 commit 6eaf92f
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions t/t3903-stash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -556,4 +556,23 @@ test_expect_success 'stash branch should not drop the stash if the branch exists
git rev-parse stash@{0} --
'

test_expect_success 'stash apply shows status same as git status (relative to current directory)' '
git stash clear &&
echo 1 >subdir/subfile1 &&
echo 2 >subdir/subfile2 &&
git add subdir/subfile1 &&
git commit -m subdir &&
(
cd subdir &&
echo x >subfile1 &&
echo x >../file &&
git status >../expect &&
git stash &&
sane_unset GIT_MERGE_VERBOSITY &&
git stash apply
) |
sed -e 1,2d >actual && # drop "Saved..." and "HEAD is now..."
test_cmp expect actual
'

test_done

0 comments on commit 6eaf92f

Please sign in to comment.