Code

Merge branch 'jk/maint-rmdir-fix' into maint-1.6.6
[git.git] / t / t7060-wtstatus.sh
1 #!/bin/sh
3 test_description='basic work tree status reporting'
5 . ./test-lib.sh
7 test_expect_success setup '
8         test_commit A &&
9         test_commit B oneside added &&
10         git checkout A^0 &&
11         test_commit C oneside created
12 '
14 test_expect_success 'A/A conflict' '
15         git checkout B^0 &&
16         test_must_fail git merge C
17 '
19 test_expect_success 'Report path with conflict' '
20         git diff --cached --name-status >actual &&
21         echo "U oneside" >expect &&
22         test_cmp expect actual
23 '
25 test_expect_success 'Report new path with conflict' '
26         git diff --cached --name-status HEAD^ >actual &&
27         echo "U oneside" >expect &&
28         test_cmp expect actual
29 '
31 cat >expect <<EOF
32 # On branch side
33 # Unmerged paths:
34 #   (use "git reset HEAD <file>..." to unstage)
35 #   (use "git add <file>..." to mark resolution)
36 #
37 #       deleted by us:      foo
38 #
39 no changes added to commit (use "git add" and/or "git commit -a")
40 EOF
42 test_expect_success 'M/D conflict does not segfault' '
43         mkdir mdconflict &&
44         (
45                 cd mdconflict &&
46                 git init &&
47                 test_commit initial foo "" &&
48                 test_commit modify foo foo &&
49                 git checkout -b side HEAD^ &&
50                 git rm foo &&
51                 git commit -m delete &&
52                 test_must_fail git merge master &&
53                 test_must_fail git status > ../actual
54         ) &&
55         test_cmp expect actual
56 '
58 test_done