Restore `stg sink --nopush` capability
[stgit.git] / t / t3303-edit-binary.sh
blobd5e402b6f4bb23813f353cfc2286c72176fed519
1 #!/bin/sh
2 test_description='Test "stg edit" with binary files'
4 . ./test-lib.sh
6 test_expect_success 'Initialize repo' '
7 test_commit_bulk --message="p%s" 3 &&
8 stg init &&
9 stg uncommit -n 3 &&
10 printf "\000\001\002" > foo.bin &&
11 cp foo.bin foo.bin.orig &&
12 stg add foo.bin &&
13 stg new -m bin-patch &&
14 stg refresh
17 write_script diffedit <<EOF
18 sed 's/^bin-patch/BIN-PATCH/' "\$1" > "\$1".tmp && mv "\$1".tmp "\$1"
19 EOF
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"
29 EOF
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
35 test_done