Add test: git stash shows status relative to current dir
[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>
Piotr Krukowiecki committed
Mar 14, 2011 at 20:19 UTC
6eaf92f3d08180da4a6bd40035919a7e07ffed5a
1 file changed
+19
t/t3903-stash.sh
+19
@@ -556,4 +556,23 @@ test_expect_success 'stash branch should not drop the stash if the branch exists
556
git rev-parse stash@{0} --
557
'
558
559
+test_expect_success 'stash apply shows status same as git status (relative to current directory)' '
560
+ git stash clear &&
561
+ echo 1 >subdir/subfile1 &&
562
+ echo 2 >subdir/subfile2 &&
563
+ git add subdir/subfile1 &&
564
+ git commit -m subdir &&
565
+ (
566
+ cd subdir &&
567
+ echo x >subfile1 &&
568
+ echo x >../file &&
569
+ git status >../expect &&
570
+ git stash &&
571
+ sane_unset GIT_MERGE_VERBOSITY &&
572
+ git stash apply
573
+ ) |
574
+ sed -e 1,2d >actual && # drop "Saved..." and "HEAD is now..."
575
+ test_cmp expect actual
576
+'
577
+
578
test_done