setup: merge configuration of repository formats
[git/gitster.git] / t / t4206-log-follow-harder-copies.sh
blob9167b0351f221205cf2700a318b8041513e34248
1 #!/bin/sh
3 # Copyright (c) 2010 Bo Yang
6 test_description='Test --follow should always find copies hard in git log.
10 TEST_PASSES_SANITIZE_LEAK=true
11 . ./test-lib.sh
12 . "$TEST_DIRECTORY"/lib-diff.sh
14 echo >path0 'Line 1
15 Line 2
16 Line 3
19 test_expect_success 'add a file path0 and commit.' '
20 git add path0 &&
21 git commit -m "Add path0"
24 echo >path0 'New line 1
25 New line 2
26 New line 3
28 test_expect_success 'Change path0.' '
29 git add path0 &&
30 git commit -m "Change path0"
33 cat <path0 >path1
34 test_expect_success 'copy path0 to path1.' '
35 git add path1 &&
36 git commit -m "Copy path1 from path0"
39 test_expect_success 'find the copy path0 -> path1 harder' '
40 git log --follow --name-status --pretty="format:%s" path1 > current
43 cat >expected <<\EOF
44 Copy path1 from path0
45 C100 path0 path1
47 Change path0
48 M path0
50 Add path0
51 A path0
52 EOF
54 test_expect_success 'validate the output.' '
55 compare_diff_patch current expected
58 test_done