231
232
'
233
234
+test_expect_success 'rev-list --exclude with --branches' '
235
+ compare rev-list "--exclude=*/* --branches" "master someref subspace-x"
236
+'
237
+
238
+test_expect_success 'rev-list --exclude with --all' '
239
+ compare rev-list "--exclude=refs/remotes/* --all" "--branches --tags"
240
+'
241
+
242
+test_expect_success 'rev-list accumulates multiple --exclude' '
243
+ compare rev-list "--exclude=refs/remotes/* --exclude=refs/tags/* --all" --branches
244
+'
245
+
246
+
247
+# "git rev-list<ENTER>" is likely to be a bug in the calling script and may
248
+# deserve an error message, but do cases where set of refs programatically
249
+# given using globbing and/or --stdin need to fail with the same error, or
250
+# are we better off reporting a success with no output? The following few
251
+# tests document the current behaviour to remind us that we might want to
252
+# think about this issue.
253
+
254
+test_expect_failure 'rev-list may want to succeed with empty output on no input (1)' '
255
+ >expect &&
256
+ git rev-list --stdin <expect >actual &&
257
+ test_cmp expect actual
258
+'
259
+
260
+test_expect_failure 'rev-list may want to succeed with empty output on no input (2)' '
261
+ >expect &&
262
+ git rev-list --exclude=* --all >actual &&
263
+ test_cmp expect actual
264
+'
265
+
266
+test_expect_failure 'rev-list may want to succeed with empty output on no input (3)' '
267
+ (
268
+ test_create_repo empty &&
269
+ cd empty &&
270
+ >expect &&
271
+ git rev-list --all >actual &&
272
+ test_cmp expect actual
273
+ )
274
+'
275
+
276
test_expect_success 'shortlog accepts --glob/--tags/--remotes' '
277
278
compare shortlog "subspace/one subspace/two" --branches=subspace &&