Merge branch 'ds/mailmap'
[git/debian.git] / t / t3012-ls-files-dedup.sh
blob2682b1f43a666564a6f74bd20deca547f721ac34
1 #!/bin/sh
3 test_description='git ls-files --deduplicate test'
5 . ./test-lib.sh
7 test_expect_success 'setup' '
8 >a.txt &&
9 >b.txt &&
10 >delete.txt &&
11 git add a.txt b.txt delete.txt &&
12 git commit -m base &&
13 echo a >a.txt &&
14 echo b >b.txt &&
15 echo delete >delete.txt &&
16 git add a.txt b.txt delete.txt &&
17 git commit -m tip &&
18 git tag tip &&
19 git reset --hard HEAD^ &&
20 echo change >a.txt &&
21 git commit -a -m side &&
22 git tag side
25 test_expect_success 'git ls-files --deduplicate to show unique unmerged path' '
26 test_must_fail git merge tip &&
27 git ls-files --deduplicate >actual &&
28 cat >expect <<-\EOF &&
29 a.txt
30 b.txt
31 delete.txt
32 EOF
33 test_cmp expect actual &&
34 git merge --abort
37 test_expect_success 'git ls-files -d -m --deduplicate with different display options' '
38 git reset --hard side &&
39 test_must_fail git merge tip &&
40 rm delete.txt &&
41 git ls-files -d -m --deduplicate >actual &&
42 cat >expect <<-\EOF &&
43 a.txt
44 delete.txt
45 EOF
46 test_cmp expect actual &&
47 git ls-files -d -m -t --deduplicate >actual &&
48 cat >expect <<-\EOF &&
49 C a.txt
50 C a.txt
51 C a.txt
52 R delete.txt
53 C delete.txt
54 EOF
55 test_cmp expect actual &&
56 git ls-files -d -m -c --deduplicate >actual &&
57 cat >expect <<-\EOF &&
58 a.txt
59 b.txt
60 delete.txt
61 EOF
62 test_cmp expect actual &&
63 git merge --abort
66 test_done