test-lib-functions.sh: remove misleading comment on test_seq
[gitweb.git] / t / t3903-stash.sh
index 1e29962fad30edb263cd07b6586f1b1a962c88cf..f5f18b7d21c00da258125a9125a46b32cf9e8504 100755 (executable)
@@ -10,6 +10,8 @@ test_description='Test git stash'
 test_expect_success 'stash some dirty working directory' '
        echo 1 > file &&
        git add file &&
+       echo unrelated >other-file &&
+       git add other-file &&
        test_tick &&
        git commit -m initial &&
        echo 2 > file &&
@@ -45,8 +47,6 @@ test_expect_success 'applying bogus stash does nothing' '
 
 test_expect_success 'apply does not need clean working directory' '
        echo 4 >other-file &&
-       git add other-file &&
-       echo 5 >other-file &&
        git stash apply &&
        echo 3 >expect &&
        test_cmp expect file
@@ -93,6 +93,10 @@ test_expect_success 'unstashing in a subdirectory' '
        )
 '
 
+test_expect_success 'stash drop complains of extra options' '
+       test_must_fail git stash drop --foo
+'
+
 test_expect_success 'drop top stash' '
        git reset --hard &&
        git stash list > stashlist1 &&
@@ -695,8 +699,8 @@ test_expect_success 'setup stash with index and worktree changes' '
 '
 
 test_expect_success 'stash list implies --first-parent -m' '
-       cat >expect <<-\EOF &&
-       stash@{0}: WIP on master: b27a2bc subdir
+       cat >expect <<-EOF &&
+       stash@{0}
 
        diff --git a/file b/file
        index 257cc56..d26b33d 100644
@@ -706,13 +710,13 @@ test_expect_success 'stash list implies --first-parent -m' '
        -foo
        +working
        EOF
-       git stash list -p >actual &&
+       git stash list --format=%gd -p >actual &&
        test_cmp expect actual
 '
 
 test_expect_success 'stash list --cc shows combined diff' '
        cat >expect <<-\EOF &&
-       stash@{0}: WIP on master: b27a2bc subdir
+       stash@{0}
 
        diff --cc file
        index 257cc56,9015a7a..d26b33d
@@ -723,7 +727,7 @@ test_expect_success 'stash list --cc shows combined diff' '
         -index
        ++working
        EOF
-       git stash list -p --cc >actual &&
+       git stash list --format=%gd -p --cc >actual &&
        test_cmp expect actual
 '