t/README: add missing value for GIT_TEST_DEFAULT_REF_FORMAT
[git/gitster.git] / t / t4043-diff-rename-binary.sh
blobe4864939081a8c7da1f4e9b6d8e0a3a72ba0a657
1 #!/bin/sh
3 # Copyright (c) 2010 Jakub Narebski, Christian Couder
6 test_description='Move a binary file'
8 TEST_PASSES_SANITIZE_LEAK=true
9 . ./test-lib.sh
12 test_expect_success 'prepare repository' '
13 git init &&
14 echo foo > foo &&
15 echo "barQ" | q_to_nul > bar &&
16 git add . &&
17 git commit -m "Initial commit"
20 test_expect_success 'move the files into a "sub" directory' '
21 mkdir sub &&
22 git mv bar foo sub/ &&
23 git commit -m "Moved to sub/"
26 cat > expected <<\EOF
27 - - bar => sub/bar
28 0 0 foo => sub/foo
30 diff --git a/bar b/sub/bar
31 similarity index 100%
32 rename from bar
33 rename to sub/bar
34 diff --git a/foo b/sub/foo
35 similarity index 100%
36 rename from foo
37 rename to sub/foo
38 EOF
40 test_expect_success 'git show -C -C report renames' '
41 git show -C -C --raw --binary --numstat >patch-with-stat &&
42 tail -n 11 patch-with-stat >current &&
43 test_cmp expected current
46 test_done