~ubuntu-branches/ubuntu/intrepid/git-core/intrepid-updates

« back to all changes in this revision

Viewing changes to t/t7201-co.sh

  • Committer: Package Import Robot
  • Author(s): Gerrit Pape
  • Date: 2007-04-22 13:31:05 UTC
  • mfrom: (1.1.14)
  • Revision ID: package-import@ubuntu.com-20070422133105-tkmhz328g2p0epz1
Tags: 1:1.5.1.2-1
* new upstream point release.
* debian/changelog.upstream: upstream changes taken from mailing list
  announcement.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
        done
15
15
}
16
16
 
 
17
 
17
18
test_expect_success setup '
18
19
 
19
 
        fill 1 2 3 4 5 >one &&
 
20
        fill 1 2 3 4 5 6 7 8 >one &&
20
21
        fill a b c d e >two &&
21
22
        git add one two &&
22
23
        git commit -m "Initial A one, A two" &&
23
24
 
24
 
        git checkout -b side &&
25
 
        fill 1 2 3 >one &&
 
25
        git checkout -b renamer &&
 
26
        rm -f one &&
 
27
        fill 1 3 4 5 6 7 8 >uno &&
 
28
        git add uno &&
 
29
        fill a b c d e f >two &&
 
30
        git commit -a -m "Renamer R one->uno, M two" &&
 
31
 
 
32
        git checkout -b side master &&
 
33
        fill 1 2 3 4 5 6 7 >one &&
26
34
        fill A B C D E >three &&
27
35
        rm -f two &&
28
36
        git update-index --add --remove one two three &&
42
50
 
43
51
test_expect_success "checkout with dirty tree without -m" '
44
52
 
45
 
        fill 0 1 2 3 4 5 >one &&
 
53
        fill 0 1 2 3 4 5 6 7 8 >one &&
46
54
        if git checkout side
47
55
        then
48
56
                echo Not happy
58
66
        git checkout -f master &&
59
67
        git clean &&
60
68
 
61
 
        fill 0 1 2 3 4 5 >one &&
 
69
        fill 0 1 2 3 4 5 6 7 8 >one &&
62
70
        git checkout -m side &&
63
71
 
64
 
        fill "  master" "* side" >expect.branch &&
65
 
        git branch >current.branch &&
66
 
        diff expect.branch current.branch &&
 
72
        test "$(git symbolic-ref HEAD)" = "refs/heads/side" &&
67
73
 
68
74
        fill "M one" "A three" "D       two" >expect.master &&
69
75
        git diff --name-status master >current.master &&
78
84
        diff expect.index current.index
79
85
'
80
86
 
 
87
test_expect_success "checkout -m with dirty tree, renamed" '
 
88
 
 
89
        git checkout -f master && git clean &&
 
90
 
 
91
        fill 1 2 3 4 5 7 8 >one &&
 
92
        if git checkout renamer
 
93
        then
 
94
                echo Not happy
 
95
                false
 
96
        else
 
97
                echo "happy - failed correctly"
 
98
        fi &&
 
99
 
 
100
        git checkout -m renamer &&
 
101
        fill 1 3 4 5 7 8 >expect &&
 
102
        diff expect uno &&
 
103
        ! test -f one &&
 
104
        git diff --cached >current &&
 
105
        ! test -s current
 
106
 
 
107
'
 
108
 
 
109
test_expect_success 'checkout -m with merge conflict' '
 
110
 
 
111
        git checkout -f master && git clean &&
 
112
 
 
113
        fill 1 T 3 4 5 6 S 8 >one &&
 
114
        if git checkout renamer
 
115
        then
 
116
                echo Not happy
 
117
                false
 
118
        else
 
119
                echo "happy - failed correctly"
 
120
        fi &&
 
121
 
 
122
        git checkout -m renamer &&
 
123
 
 
124
        git diff master:one :3:uno |
 
125
        sed -e "1,/^@@/d" -e "/^ /d" -e "s/^-/d/" -e "s/^+/a/" >current &&
 
126
        fill d2 aT d7 aS >expect &&
 
127
        diff current expect &&
 
128
        git diff --cached two >current &&
 
129
        ! test -s current
 
130
'
 
131
 
81
132
test_done