Re: [PATCH v3 02/14] t5500: add tests of fetch-pack --all --depth=N $URL $REF

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

 



Michael Haggerty <mhagger@xxxxxxxxxxxx> writes:

> Document some bugs in "git fetch-pack":
>
> 1. If "git fetch-pack" is called with "--all", "--depth", and an
> explicit existing non-tag reference to fetch, then it falsely reports
> that the reference was not found, even though it was fetched
> correctly.
>
> 2. If "git fetch-pack" is called with "--all", "--depth", and an
> explicit existing tag reference to fetch, then it segfaults in
> filter_refs() because return_refs is used without having been
> initialized.

I guess the first one is because "all" already marks the fetched one
"used", and does not allow the explicit one to match any unused one
from the other side?  I wonder what happens when "--all" with an
explicit refspec that names non-existing ref is asked for (it should
notice that refs/heads/no-such-ref does not exist.  I do not know if
it is something that belongs to this set of new tests)?

It is funny that this only happens with "--depth" (I think I know
which part of the code introduces this bug, so it is not all that
interesting, but just funny).

Thanks for working on these glitches.

> Signed-off-by: Michael Haggerty <mhagger@xxxxxxxxxxxx>
> ---
>  t/t5500-fetch-pack.sh | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh
> index 6fa1cef..15d277f 100755
> --- a/t/t5500-fetch-pack.sh
> +++ b/t/t5500-fetch-pack.sh
> @@ -427,4 +427,19 @@ test_expect_success 'test missing ref before existing' '
>  	test_cmp expect-error error-me
>  '
>  
> +test_expect_failure 'test --all, --depth, and explicit head' '
> +	(
> +		cd client &&
> +		git fetch-pack --no-progress --all --depth=1 .. refs/heads/A
> +	) >out-adh 2>error-adh
> +'
> +
> +test_expect_failure 'test --all, --depth, and explicit tag' '
> +	git tag OLDTAG refs/heads/B~5 &&
> +	(
> +		cd client &&
> +		git fetch-pack --no-progress --all --depth=1 .. refs/tags/OLDTAG
> +	) >out-adt 2>error-adt
> +'
> +
>  test_done
--
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]