Re: [PATCH v2] config: correct '**' matching in includeIf patterns

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

 



Hi Duy,

On Sun, 24 Mar 2019, Nguyễn Thái Ngọc Duy wrote:

> diff --git a/t/t1305-config-include.sh b/t/t1305-config-include.sh
> index 635918505d..4d6e70c11d 100755
> --- a/t/t1305-config-include.sh
> +++ b/t/t1305-config-include.sh
> @@ -229,6 +229,19 @@ test_expect_success 'conditional include, early config reading' '
>  	)
>  '
>
> +test_expect_success 'conditional include with /**/' '
> +	mkdir foo/bar &&

This does assume that no previous test case created `bar`, but that `foo`
was created (which makes it harder to use `--run=<N>` for quicker
testing/debugging). It would be better to use

	mkdir -p foo/bar &&

here. Or *even* better...

> +	git init foo/bar/repo &&

... just drop the `mkdir foo/bar`, as `git init foo/bar/repo` has not the
slightest problem creating the intermediate directories.

> +	(
> +		cd foo/bar/repo &&
> +		echo "[includeIf \"gitdir:**/foo/**/bar/**\"]path=bar7" >>.git/config &&

This line is longer than the 80 columns asked for in SubmittingPatches,
and while you have to wrap the line anyway, why not avoid the `cd`, too?

	echo "[includeIf \"gitdir:**/foo/**/bar/**\"]path=bar7" \
		>>foo/bar/repo/.git/config &&
	echo "[test]seven=7" >foo/bar/repo/.git/bar7 &&
	echo 7 >expect &&
	git -C foo/bar/repo config test.seven >actual &&
	test_cmp expect actual

Ciao,
Johannes

> +		echo "[test]seven=7" >.git/bar7 &&
> +		echo 7 >expect &&
> +		git config test.seven >actual &&
> +		test_cmp expect actual
> +	)
> +'
> +
>  test_expect_success SYMLINKS 'conditional include, set up symlinked $HOME' '
>  	mkdir real-home &&
>  	ln -s real-home home &&
> --
> 2.21.0.479.g47ac719cd3
>
>

[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