diff options
author | Junio C Hamano <gitster@pobox.com> | 2023-12-20 19:14:53 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-12-20 19:14:53 +0100 |
commit | c4bf868bee2fe36c42c3033ceba725553d729ecf (patch) | |
tree | 9cf5045b3bec28f5b74af0e5f3b35b297a399de7 /t/t6009-rev-list-parent.sh | |
parent | Merge branch 'mk/doc-gitfile-more' (diff) | |
parent | revision: parse integer arguments to --max-count, --skip, etc., more carefully (diff) | |
download | git-c4bf868bee2fe36c42c3033ceba725553d729ecf.tar.xz git-c4bf868bee2fe36c42c3033ceba725553d729ecf.zip |
Merge branch 'jc/revision-parse-int'
The command line parser for the "log" family of commands was too
loose when parsing certain numbers, e.g., silently ignoring the
extra 'q' in "git log -n 1q" without complaining, which has been
tightened up.
* jc/revision-parse-int:
revision: parse integer arguments to --max-count, --skip, etc., more carefully
Diffstat (limited to 't/t6009-rev-list-parent.sh')
-rwxr-xr-x | t/t6009-rev-list-parent.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t6009-rev-list-parent.sh b/t/t6009-rev-list-parent.sh index ced40157ed..91db8fafe8 100755 --- a/t/t6009-rev-list-parent.sh +++ b/t/t6009-rev-list-parent.sh @@ -63,6 +63,17 @@ test_expect_success 'setup roots, merges and octopuses' ' git checkout main ' +test_expect_success 'parse --max-parents & --min-parents' ' + test_must_fail git rev-list --max-parents=1q HEAD 2>error && + grep "not an integer" error && + + test_must_fail git rev-list --min-parents=1q HEAD 2>error && + grep "not an integer" error && + + git rev-list --max-parents=1 --min-parents=1 HEAD && + git rev-list --max-parents=-1 --min-parents=-1 HEAD +' + test_expect_success 'rev-list roots' ' check_revlist "--max-parents=0" one five |