]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'aj/stash-staged-fix' into maint-2.45
authorJunio C Hamano <gitster@pobox.com>
Fri, 28 Jun 2024 22:53:07 +0000 (15:53 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 28 Jun 2024 22:53:07 +0000 (15:53 -0700)
"git stash -S" did not handle binary files correctly, which has
been corrected.

* aj/stash-staged-fix:
  stash: fix "--staged" with binary files

1  2 
builtin/stash.c
t/t3903-stash.sh

diff --cc builtin/stash.c
Simple merge
index 00db82fb2455b8397de6ae0e5ea8e4fd96ed3d6c,a62b3a3d40bf6e00581526da1002c44ff18a7641..a7f71f8126fce48ef58e32d89f628a91bf234899
@@@ -393,9 -318,18 +393,18 @@@ 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_i18ngrep -e "subcommand wasn'\''t specified; '\''push'\'' can'\''t be assumed due to unexpected token '\''drop'\''" err
 +      test_grep -e "subcommand wasn'\''t specified; '\''push'\'' can'\''t be assumed due to unexpected token '\''drop'\''" err
  '
  
  test_expect_success 'stash --invalid-option' '