2 test_description
='Test "stg edit" with binary files'
6 test_expect_success
'Initialize repo' '
7 test_commit_bulk --message="p%s" 3 &&
10 printf "\000\001\002" > foo.bin &&
11 cp foo.bin foo.bin.orig &&
13 stg new -m bin-patch &&
17 write_script diffedit
<<EOF
18 sed 's/^bin-patch/BIN-PATCH/' "\$1" > "\$1".tmp && mv "\$1".tmp "\$1"
21 test_expect_success
'Edit bin-patch description' '
22 EDITOR=./diffedit stg edit -d &&
23 stg show | grep " BIN-PATCH" &&
24 test_cmp_bin foo.bin.orig foo.bin
27 write_script diffedit
<<EOF
28 grep "Binary files \/dev\/null and b\/foo.bin differ" "\$1"
30 test_expect_success
'Ensure binary patch is not present' '
31 EDITOR=./diffedit stg edit -d &&
32 test_cmp_bin foo.bin.orig foo.bin