Christian Couder | 296c6bb | 2010-05-26 04:50:12 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # Copyright (c) 2010 Jakub Narebski, Christian Couder |
| 4 | # |
| 5 | |
| 6 | test_description='Move a binary file' |
| 7 | |
| 8 | . ./test-lib.sh |
| 9 | |
| 10 | |
| 11 | test_expect_success 'prepare repository' ' |
| 12 | git init && |
| 13 | echo foo > foo && |
| 14 | echo "barQ" | q_to_nul > bar && |
| 15 | git add . && |
| 16 | git commit -m "Initial commit" |
| 17 | ' |
| 18 | |
| 19 | test_expect_success 'move the files into a "sub" directory' ' |
| 20 | mkdir sub && |
| 21 | git mv bar foo sub/ && |
| 22 | git commit -m "Moved to sub/" |
| 23 | ' |
| 24 | |
| 25 | cat > expected <<\EOF |
Jonathan Nieder | 6dd8883 | 2012-03-13 00:05:54 -0500 | [diff] [blame] | 26 | - - bar => sub/bar |
| 27 | 0 0 foo => sub/foo |
Christian Couder | 296c6bb | 2010-05-26 04:50:12 +0200 | [diff] [blame] | 28 | |
| 29 | diff --git a/bar b/sub/bar |
| 30 | similarity index 100% |
| 31 | rename from bar |
| 32 | rename to sub/bar |
| 33 | diff --git a/foo b/sub/foo |
| 34 | similarity index 100% |
| 35 | rename from foo |
| 36 | rename to sub/foo |
| 37 | EOF |
| 38 | |
| 39 | test_expect_success 'git show -C -C report renames' ' |
Jonathan Nieder | 6dd8883 | 2012-03-13 00:05:54 -0500 | [diff] [blame] | 40 | git show -C -C --raw --binary --numstat >patch-with-stat && |
| 41 | tail -n 11 patch-with-stat >current && |
Christian Couder | 296c6bb | 2010-05-26 04:50:12 +0200 | [diff] [blame] | 42 | test_cmp expected current |
| 43 | ' |
| 44 | |
| 45 | test_done |