diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-03-23 12:13:14 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-03-23 21:38:41 +0300 |
commit | 0f8878359207191195867ebd499abba3710f9f4b (patch) | |
tree | b5bed6f68cab32eaf402b155472da7621624458f /t/t3103-ls-tree-misc.sh | |
parent | cab851c2f8c190bed93719ca8c712fdfcc3c7182 (diff) |
ls-tree: detect and error on --name-only --name-status
The --name-only and --name-status options are synonyms, but let's
detect and error if both are provided.
In addition let's add explicit --format tests for the combination of
these various options.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Teng Long <dyroneteng@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3103-ls-tree-misc.sh')
-rwxr-xr-x | t/t3103-ls-tree-misc.sh | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/t/t3103-ls-tree-misc.sh b/t/t3103-ls-tree-misc.sh index d979c0df5d..81c6343962 100755 --- a/t/t3103-ls-tree-misc.sh +++ b/t/t3103-ls-tree-misc.sh @@ -24,15 +24,18 @@ test_expect_success 'ls-tree fails with non-zero exit code on broken tree' ' ' for opts in \ - "--name-only --long" \ - "--name-status --long" \ - "--name-only --object-only" \ + "--long --name-only" \ + "--name-only --name-status" \ "--name-status --object-only" \ - "--object-only --long" \ - "--object-only --format" + "--object-only --long" do test_expect_success "usage: incompatible options: $opts" ' test_expect_code 129 git ls-tree $opts $tree - ' + ' + + one_opt=$(echo "$opts" | cut -d' ' -f1) + test_expect_success "usage: incompatible options: $one_opt and --format" ' + test_expect_code 129 git ls-tree $one_opt --format=fmt $tree + ' done test_done |