]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t3903-stash.sh
The seventh batch
[thirdparty/git.git] / t / t3903-stash.sh
index 3caf490e3996ec4379e84c6adfe5505723931622..a7f71f8126fce48ef58e32d89f628a91bf234899 100755 (executable)
@@ -200,7 +200,7 @@ test_expect_success 'drop stash reflog updates refs/stash' '
        test_cmp expect actual
 '
 
-test_expect_success REFFILES 'drop stash reflog updates refs/stash with rewrite' '
+test_expect_success 'drop stash reflog updates refs/stash with rewrite' '
        git init repo &&
        (
                cd repo &&
@@ -213,16 +213,16 @@ test_expect_success REFFILES 'drop stash reflog updates refs/stash with rewrite'
        new_oid="$(git -C repo rev-parse stash@{0})" &&
 
        cat >expect <<-EOF &&
-       $(test_oid zero) $old_oid
-       $old_oid $new_oid
+       $new_oid
+       $old_oid
        EOF
-       cut -d" " -f1-2 repo/.git/logs/refs/stash >actual &&
+       git -C repo reflog show refs/stash --format=%H >actual &&
        test_cmp expect actual &&
 
        git -C repo stash drop stash@{1} &&
-       cut -d" " -f1-2 repo/.git/logs/refs/stash >actual &&
+       git -C repo reflog show refs/stash --format=%H >actual &&
        cat >expect <<-EOF &&
-       $(test_oid zero) $new_oid
+       $new_oid
        EOF
        test_cmp expect actual
 '
@@ -393,6 +393,15 @@ test_expect_success 'stash --staged' '
        test bar,bar4 = $(cat file),$(cat file2)
 '
 
+test_expect_success 'stash --staged with binary file' '
+       printf "\0" >file &&
+       git add file &&
+       git stash --staged &&
+       git stash pop &&
+       printf "\0" >expect &&
+       test_cmp expect file
+'
+
 test_expect_success 'dont assume push with non-option args' '
        test_must_fail git stash -q drop 2>err &&
        test_grep -e "subcommand wasn'\''t specified; '\''push'\'' can'\''t be assumed due to unexpected token '\''drop'\''" err