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:
authorRené Scharfe <l.s.r@web.de>2023-07-18 18:44:13 +0300
committerJunio C Hamano <gitster@pobox.com>2023-07-18 19:38:24 +0300
commit991c552916d3c8fa464acfca135b4235e11792bf (patch)
tree4ae2626b4656b83edf1e8b0890a8daf6c430a3a9 /t/t3101-ls-tree-dirname.sh
parent5e238546dc7a232d8998f1cd1ec9d3f4a0add68b (diff)
ls-tree: fix --no-full-name
Since 61fdbcf98b (ls-tree: migrate to parse-options, 2009-11-13) git ls-tree has accepted the option --no-full-name, but it does the same as --full-name, contrary to convention. That's because it's defined using OPT_SET_INT with a value of 0, where the negative variant sets 0 as well. Turn --no-full-name into the opposite of --full-name by using OPT_BOOL instead and storing the option's status directly in a variable named "full_name" instead of in negated form in "chomp_prefix". Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3101-ls-tree-dirname.sh')
-rwxr-xr-xt/t3101-ls-tree-dirname.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t3101-ls-tree-dirname.sh b/t/t3101-ls-tree-dirname.sh
index 217006d1bf..5af2dac0e4 100755
--- a/t/t3101-ls-tree-dirname.sh
+++ b/t/t3101-ls-tree-dirname.sh
@@ -154,6 +154,14 @@ EOF
test_output
'
+test_expect_success 'ls-tree --no-full-name' '
+ git -C path0 ls-tree --no-full-name $tree a >current &&
+ cat >expected <<-EOF &&
+ 040000 tree X a
+ EOF
+ test_output
+'
+
test_expect_success 'ls-tree --full-tree' '
(
cd path1/b/c &&