@@ -76,8 +76,8 @@ head3=$(
76
76
)
77
77
78
78
test_expect_success ' modified submodule(backward)' "
79
- git submodule summary >actual &&
80
- cat >expected <<-EOF &&
79
+ git submodule summary >actual &&
80
+ cat >expected <<-EOF &&
81
81
* sm1 $head2 ...$head3 (2):
82
82
< Add foo3
83
83
< Add foo2
89
89
head4=$( add_file sm1 foo4 foo5) &&
90
90
head4_full=$( GIT_DIR=sm1/.git git rev-parse --verify HEAD)
91
91
test_expect_success ' modified submodule(backward and forward)' "
92
- git submodule summary >actual &&
93
- cat >expected <<-EOF &&
92
+ git submodule summary >actual &&
93
+ cat >expected <<-EOF &&
94
94
* sm1 $head2 ...$head4 (4):
95
95
> Add foo5
96
96
> Add foo4
@@ -102,15 +102,15 @@ EOF
102
102
"
103
103
104
104
test_expect_success ' --summary-limit' "
105
- git submodule summary -n 3 >actual &&
106
- cat >expected <<-EOF &&
105
+ git submodule summary -n 3 >actual &&
106
+ cat >expected <<-EOF &&
107
107
* sm1 $head2 ...$head4 (4):
108
108
> Add foo5
109
109
> Add foo4
110
110
< Add foo3
111
111
112
112
EOF
113
- test_cmp expected actual
113
+ test_cmp expected actual
114
114
"
115
115
116
116
commit_file sm1 &&
@@ -122,8 +122,8 @@ rm -f sm1 &&
122
122
mv sm1-bak sm1
123
123
124
124
test_expect_success ' typechanged submodule(submodule->blob), --cached' "
125
- git submodule summary --cached >actual &&
126
- cat >expected <<-EOF &&
125
+ git submodule summary --cached >actual &&
126
+ cat >expected <<-EOF &&
127
127
* sm1 $head4 (submodule)->$head5 (blob) (3):
128
128
< Add foo5
129
129
@@ -132,103 +132,103 @@ EOF
132
132
"
133
133
134
134
test_expect_success ' typechanged submodule(submodule->blob), --files' "
135
- git submodule summary --files >actual &&
136
- cat >expected <<-EOF &&
135
+ git submodule summary --files >actual &&
136
+ cat >expected <<-EOF &&
137
137
* sm1 $head5 (blob)->$head4 (submodule) (3):
138
138
> Add foo5
139
139
140
140
EOF
141
- test_i18ncmp actual expected
141
+ test_i18ncmp actual expected
142
142
"
143
143
144
144
rm -rf sm1 &&
145
145
git checkout-index sm1
146
146
test_expect_success ' typechanged submodule(submodule->blob)' "
147
- git submodule summary >actual &&
148
- cat >expected <<-EOF &&
147
+ git submodule summary >actual &&
148
+ cat >expected <<-EOF &&
149
149
* sm1 $head4 (submodule)->$head5 (blob):
150
150
151
151
EOF
152
- test_i18ncmp actual expected
152
+ test_i18ncmp actual expected
153
153
"
154
154
155
155
rm -f sm1 &&
156
156
test_create_repo sm1 &&
157
157
head6=$( add_file sm1 foo6 foo7)
158
158
test_expect_success ' nonexistent commit' "
159
- git submodule summary >actual &&
160
- cat >expected <<-EOF &&
159
+ git submodule summary >actual &&
160
+ cat >expected <<-EOF &&
161
161
* sm1 $head4 ...$head6 :
162
162
Warn: sm1 doesn't contain commit $head4_full
163
163
164
164
EOF
165
- test_i18ncmp actual expected
165
+ test_i18ncmp actual expected
166
166
"
167
167
168
168
commit_file
169
169
test_expect_success ' typechanged submodule(blob->submodule)' "
170
- git submodule summary >actual &&
171
- cat >expected <<-EOF &&
170
+ git submodule summary >actual &&
171
+ cat >expected <<-EOF &&
172
172
* sm1 $head5 (blob)->$head6 (submodule) (2):
173
173
> Add foo7
174
174
175
175
EOF
176
- test_i18ncmp expected actual
176
+ test_i18ncmp expected actual
177
177
"
178
178
179
179
commit_file sm1 &&
180
180
rm -rf sm1
181
181
test_expect_success ' deleted submodule' "
182
- git submodule summary >actual &&
183
- cat >expected <<-EOF &&
182
+ git submodule summary >actual &&
183
+ cat >expected <<-EOF &&
184
184
* sm1 $head6 ...0000000:
185
185
186
186
EOF
187
- test_cmp expected actual
187
+ test_cmp expected actual
188
188
"
189
189
190
190
test_create_repo sm2 &&
191
191
head7=$( add_file sm2 foo8 foo9) &&
192
192
git add sm2
193
193
194
194
test_expect_success ' multiple submodules' "
195
- git submodule summary >actual &&
196
- cat >expected <<-EOF &&
195
+ git submodule summary >actual &&
196
+ cat >expected <<-EOF &&
197
197
* sm1 $head6 ...0000000:
198
198
199
199
* sm2 0000000...$head7 (2):
200
200
> Add foo9
201
201
202
202
EOF
203
- test_cmp expected actual
203
+ test_cmp expected actual
204
204
"
205
205
206
206
test_expect_success ' path filter' "
207
- git submodule summary sm2 >actual &&
208
- cat >expected <<-EOF &&
207
+ git submodule summary sm2 >actual &&
208
+ cat >expected <<-EOF &&
209
209
* sm2 0000000...$head7 (2):
210
210
> Add foo9
211
211
212
212
EOF
213
- test_cmp expected actual
213
+ test_cmp expected actual
214
214
"
215
215
216
216
commit_file sm2
217
217
test_expect_success ' given commit' "
218
- git submodule summary HEAD^ >actual &&
219
- cat >expected <<-EOF &&
218
+ git submodule summary HEAD^ >actual &&
219
+ cat >expected <<-EOF &&
220
220
* sm1 $head6 ...0000000:
221
221
222
222
* sm2 0000000...$head7 (2):
223
223
> Add foo9
224
224
225
225
EOF
226
- test_cmp expected actual
226
+ test_cmp expected actual
227
227
"
228
228
229
229
test_expect_success ' --for-status' "
230
- git submodule summary --for-status HEAD^ >actual &&
231
- test_i18ncmp actual - <<EOF
230
+ git submodule summary --for-status HEAD^ >actual &&
231
+ test_i18ncmp actual - <<EOF
232
232
# Submodule changes to be committed:
233
233
#
234
234
# * sm1 $head6 ...0000000:
@@ -240,14 +240,14 @@ EOF
240
240
"
241
241
242
242
test_expect_success ' fail when using --files together with --cached' "
243
- test_must_fail git submodule summary --files --cached
243
+ test_must_fail git submodule summary --files --cached
244
244
"
245
245
246
246
test_expect_success ' should not fail in an empty repo' "
247
- git init xyzzy &&
248
- cd xyzzy &&
249
- git submodule summary >output 2>&1 &&
250
- test_cmp output /dev/null
247
+ git init xyzzy &&
248
+ cd xyzzy &&
249
+ git submodule summary >output 2>&1 &&
250
+ test_cmp output /dev/null
251
251
"
252
252
253
253
test_done
0 commit comments