Skip to content

Commit 0c5dc74

Browse files
peffgitster
authored andcommitted
t6018: flesh out empty input/output rev-list tests
In 751a2ac (rev-list --exclude: tests, 2013-11-01), we added a few tests for handling "empty" inputs with rev-list (i.e., where the user gave us some pattern but it turned out not to queue any objects for traversal), all of which were marked as failing. In preparation for working on this area of the code, let's give each test a more descriptive name. Let's also include one more case which we should cover: feeding a --glob pattern that doesn't match anything. We can also drop the explanatory comment; we'll be converting these to expect_success in the next few patches, so the discussion isn't necessary. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 384a8b2 commit 0c5dc74

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

t/t6018-rev-list-glob.sh

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -255,27 +255,19 @@ test_expect_success 'rev-list accumulates multiple --exclude' '
255255
compare rev-list "--exclude=refs/remotes/* --exclude=refs/tags/* --all" --branches
256256
'
257257

258-
259-
# "git rev-list<ENTER>" is likely to be a bug in the calling script and may
260-
# deserve an error message, but do cases where set of refs programmatically
261-
# given using globbing and/or --stdin need to fail with the same error, or
262-
# are we better off reporting a success with no output? The following few
263-
# tests document the current behaviour to remind us that we might want to
264-
# think about this issue.
265-
266-
test_expect_failure 'rev-list may want to succeed with empty output on no input (1)' '
258+
test_expect_failure 'rev-list should succeed with empty output on empty stdin' '
267259
>expect &&
268260
git rev-list --stdin <expect >actual &&
269261
test_cmp expect actual
270262
'
271263

272-
test_expect_failure 'rev-list may want to succeed with empty output on no input (2)' '
264+
test_expect_failure 'rev-list should succeed with empty output with all refs excluded' '
273265
>expect &&
274266
git rev-list --exclude=* --all >actual &&
275267
test_cmp expect actual
276268
'
277269

278-
test_expect_failure 'rev-list may want to succeed with empty output on no input (3)' '
270+
test_expect_failure 'rev-list should succeed with empty output with empty --all' '
279271
(
280272
test_create_repo empty &&
281273
cd empty &&
@@ -285,6 +277,12 @@ test_expect_failure 'rev-list may want to succeed with empty output on no input
285277
)
286278
'
287279

280+
test_expect_failure 'rev-list should succeed with empty output with empty glob' '
281+
>expect &&
282+
git rev-list --glob=does-not-match-anything >actual &&
283+
test_cmp expect actual
284+
'
285+
288286
test_expect_success 'shortlog accepts --glob/--tags/--remotes' '
289287
290288
compare shortlog "subspace/one subspace/two" --branches=subspace &&

0 commit comments

Comments
 (0)