Re: [PATCH v2] ls-tree: fix --long implying -r regression in 9c4d58ff2c3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue,  5 Apr 2022 01:45:30 +0200, Ævar Arnfjörð Bjarmason wrote:

> Indeed. I guess that makes this a proposed v2,
> 
> I refreshed my E-Mail when I was just about to submit this and spotted
> that you'd sent your fix in, but I came up with this (in retrospect a
> pretty obvious think-o) fix independently, sorry about the bug.
> 
> The tests took me a bit longer though...
> 
> Haing written them I guess we could do them post-release, since the
> important thing is to validate the changes. As noted in the commit
> message we're now testing all combinations of the "mode" and "format"
> options.


Thanks for the quickly fix.

> +    	       git ls-tree ${opt:+$opt }$opts $opt HEAD >actual &&

I think maybe the "$opt" here should be removed, because "${opt:+$opt }"
will not append it if "$opt" is null or unset, or will append "$opt ",
like:

diff --git a/t/t3104-ls-tree-format.sh b/t/t3104-ls-tree-format.sh
index 520b5a95c0..9d3ad0295e 100755
--- a/t/t3104-ls-tree-format.sh
+++ b/t/t3104-ls-tree-format.sh
@@ -31,7 +31,7 @@ test_ls_tree_format () {
        for opt in '' '-d' '-r' '-t'
        do
                test_expect_success "'ls-tree $opts${opt:+ $opt}' output" '
-                       git ls-tree ${opt:+$opt }$opts $opt HEAD >actual &&
+                       git ls-tree ${opt:+$opt }$opts HEAD >actual &&
                        test_cmp expect${opt:+.$opt} actual
                '
        done
--

But I'm not sure it's intentional or inadvertently design or maybe I misunderstood
it here.

Thanks.



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux