Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeng Long <dyroneteng@gmail.com>2022-03-23 12:13:08 +0300
committerJunio C Hamano <gitster@pobox.com>2022-03-23 21:38:39 +0300
commitf6b224d5ebfe9fcf58ef34eddea68d9fb4384d50 (patch)
tree8752ec76332ca8ff55234d24cfa6fe7ba1dc9c63 /t/t3103-ls-tree-misc.sh
parent87af0ddf5f311e9b6e361daaa7fd591a230261a0 (diff)
ls-tree: fix "--name-only" and "--long" combined use bug
If we execute "git ls-tree" with combined "--name-only" and "--long" , only the pathname will be printed, the size is omitted (the original discoverer was Peff in [1]). This commit fix this issue by using `OPT_CMDMODE()` instead to make both of them mutually exclusive. [1] https://public-inbox.org/git/YZK0MKCYAJmG+pSU@coredump.intra.peff.net/ Helped-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-xt/t3103-ls-tree-misc.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/t3103-ls-tree-misc.sh b/t/t3103-ls-tree-misc.sh
index d18ba1bd84..d9d7fa932f 100755
--- a/t/t3103-ls-tree-misc.sh
+++ b/t/t3103-ls-tree-misc.sh
@@ -23,4 +23,13 @@ test_expect_success 'ls-tree fails with non-zero exit code on broken tree' '
test_must_fail git ls-tree -r HEAD
'
+for opts in \
+ "--name-only --long" \
+ "--name-status --long"
+do
+ test_expect_success "usage: incompatible options: $opts" '
+ test_expect_code 129 git ls-tree $opts $tree
+ '
+done
+
test_done