Re: [PATCH 1/2] t7406: correct depth test in shallow test

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

 



Stefan Beller <sbeller@xxxxxxxxxx> writes:

> We used to ask for 3 changes and tested for having 1, so the test
> seems broken.

I am not sure what to think of "seems broken".

Asking for 3 and having 1 is broken in what way?  Should we be
expecting for 3 because we asked for that many?  Should we expect
less than three even though we asked for three because the upstream
side does not even have that many?  If the current test that asks
for 3 and gets only 1 is not failing, why should we expect that
asking for 2 would get 2?  In other words, why is it sane that
asking for fewer number of commits gives us more?

Also most of the lines in this subshell seem to be breaking
&&-chain.



> Correct the test by using test_line_count that exists in the test suite.
>
> Signed-off-by: Stefan Beller <sbeller@xxxxxxxxxx>
> ---
>  t/t7406-submodule-update.sh | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
> index 88e9750..bd261ac 100755
> --- a/t/t7406-submodule-update.sh
> +++ b/t/t7406-submodule-update.sh
> @@ -846,9 +846,10 @@ test_expect_success 'submodule update clone shallow submodule' '
>  	(cd super3 &&
>  	 sed -e "s#url = ../#url = file://$pwd/#" <.gitmodules >.gitmodules.tmp &&
>  	 mv -f .gitmodules.tmp .gitmodules &&
> -	 git submodule update --init --depth=3
> +	 git submodule update --init --depth=2
>  	 (cd submodule &&
> -	  test 1 = $(git log --oneline | wc -l)
> +	  git log --oneline >lines
> +	  test_line_count = 2 lines
>  	 )
>  )
>  '
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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]