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

« back to all changes in this revision

Viewing changes to t/lib-read-tree-m-3way.sh

  • Committer: Package Import Robot
  • Author(s): Gerrit Pape
  • Date: 2007-10-04 08:27:01 UTC
  • mfrom: (1.1.23)
  • Revision ID: package-import@ubuntu.com-20071004082701-rsd058ontoqz4i30
Tags: 1:1.5.3.4-1
new upstream point release (closes: #445188).

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
        echo This is Z/$p from the original tree. >Z/$p
11
11
        test_expect_success \
12
12
            "adding test file $p and Z/$p" \
13
 
            'git-update-index --add $p &&
14
 
            git-update-index --add Z/$p'
 
13
            'git update-index --add $p &&
 
14
            git update-index --add Z/$p'
15
15
    done
16
16
done
17
17
echo This is SS from the original tree. >SS
18
18
test_expect_success \
19
19
    'adding test file SS' \
20
 
    'git-update-index --add SS'
 
20
    'git update-index --add SS'
21
21
cat >TT <<\EOF
22
22
This is a trivial merge sample text.
23
23
Branch A is expected to upcase this word, here.
32
32
EOF
33
33
test_expect_success \
34
34
    'adding test file TT' \
35
 
    'git-update-index --add TT'
 
35
    'git update-index --add TT'
36
36
test_expect_success \
37
37
    'prepare initial tree' \
38
 
    'tree_O=$(git-write-tree)'
 
38
    'tree_O=$(git write-tree)'
39
39
 
40
40
################################################################
41
41
# Branch A and B makes the changes according to the above matrix.
47
47
rm -f $to_remove
48
48
test_expect_success \
49
49
    'change in branch A (removal)' \
50
 
    'git-update-index --remove $to_remove'
 
50
    'git update-index --remove $to_remove'
51
51
 
52
52
for p in M? Z/M?
53
53
do
54
54
    echo This is modified $p in the branch A. >$p
55
55
    test_expect_success \
56
56
        'change in branch A (modification)' \
57
 
        "git-update-index $p"
 
57
        "git update-index $p"
58
58
done
59
59
 
60
60
for p in AN AA Z/AN Z/AA
62
62
    echo This is added $p in the branch A. >$p
63
63
    test_expect_success \
64
64
        'change in branch A (addition)' \
65
 
        "git-update-index --add $p"
 
65
        "git update-index --add $p"
66
66
done
67
67
 
68
68
echo This is SS from the modified tree. >SS
69
69
echo This is LL from the modified tree. >LL
70
70
test_expect_success \
71
71
    'change in branch A (addition)' \
72
 
    'git-update-index --add LL &&
73
 
     git-update-index SS'
 
72
    'git update-index --add LL &&
 
73
     git update-index SS'
74
74
mv TT TT-
75
75
sed -e '/Branch A/s/word/WORD/g' <TT- >TT
76
76
rm -f TT-
77
77
test_expect_success \
78
78
    'change in branch A (edit)' \
79
 
    'git-update-index TT'
 
79
    'git update-index TT'
80
80
 
81
81
mkdir DF
82
82
echo Branch A makes a file at DF/DF, creating a directory DF. >DF/DF
83
83
test_expect_success \
84
84
    'change in branch A (change file to directory)' \
85
 
    'git-update-index --add DF/DF'
 
85
    'git update-index --add DF/DF'
86
86
 
87
87
test_expect_success \
88
88
    'recording branch A tree' \
89
 
    'tree_A=$(git-write-tree)'
90
 
           
 
89
    'tree_A=$(git write-tree)'
 
90
 
91
91
################################################################
92
92
# Branch B
93
93
# Start from O
96
96
mkdir Z
97
97
test_expect_success \
98
98
    'reading original tree and checking out' \
99
 
    'git-read-tree $tree_O &&
100
 
     git-checkout-index -a'
 
99
    'git read-tree $tree_O &&
 
100
     git checkout-index -a'
101
101
 
102
102
to_remove=$(echo ?D Z/?D)
103
103
rm -f $to_remove
104
104
test_expect_success \
105
105
    'change in branch B (removal)' \
106
 
    "git-update-index --remove $to_remove"
 
106
    "git update-index --remove $to_remove"
107
107
 
108
108
for p in ?M Z/?M
109
109
do
110
110
    echo This is modified $p in the branch B. >$p
111
111
    test_expect_success \
112
112
        'change in branch B (modification)' \
113
 
        "git-update-index $p"
 
113
        "git update-index $p"
114
114
done
115
115
 
116
116
for p in NA AA Z/NA Z/AA
118
118
    echo This is added $p in the branch B. >$p
119
119
    test_expect_success \
120
120
        'change in branch B (addition)' \
121
 
        "git-update-index --add $p"
 
121
        "git update-index --add $p"
122
122
done
123
123
echo This is SS from the modified tree. >SS
124
124
echo This is LL from the modified tree. >LL
125
125
test_expect_success \
126
126
    'change in branch B (addition and modification)' \
127
 
    'git-update-index --add LL &&
128
 
     git-update-index SS'
 
127
    'git update-index --add LL &&
 
128
     git update-index SS'
129
129
mv TT TT-
130
130
sed -e '/Branch B/s/word/WORD/g' <TT- >TT
131
131
rm -f TT-
132
132
test_expect_success \
133
133
    'change in branch B (modification)' \
134
 
    'git-update-index TT'
 
134
    'git update-index TT'
135
135
 
136
136
echo Branch B makes a file at DF. >DF
137
137
test_expect_success \
138
138
    'change in branch B (addition of a file to conflict with directory)' \
139
 
    'git-update-index --add DF'
 
139
    'git update-index --add DF'
140
140
 
141
141
test_expect_success \
142
142
    'recording branch B tree' \
143
 
    'tree_B=$(git-write-tree)'
 
143
    'tree_B=$(git write-tree)'
144
144
 
145
145
test_expect_success \
146
146
    'keep contents of 3 trees for easy access' \
147
147
    'rm -f .git/index &&
148
 
     git-read-tree $tree_O &&
 
148
     git read-tree $tree_O &&
149
149
     mkdir .orig-O &&
150
 
     git-checkout-index --prefix=.orig-O/ -f -q -a &&
 
150
     git checkout-index --prefix=.orig-O/ -f -q -a &&
151
151
     rm -f .git/index &&
152
 
     git-read-tree $tree_A &&
 
152
     git read-tree $tree_A &&
153
153
     mkdir .orig-A &&
154
 
     git-checkout-index --prefix=.orig-A/ -f -q -a &&
 
154
     git checkout-index --prefix=.orig-A/ -f -q -a &&
155
155
     rm -f .git/index &&
156
 
     git-read-tree $tree_B &&
 
156
     git read-tree $tree_B &&
157
157
     mkdir .orig-B &&
158
 
     git-checkout-index --prefix=.orig-B/ -f -q -a'
 
158
     git checkout-index --prefix=.orig-B/ -f -q -a'