Re: [PATCH v2] config: correct '**' matching in includeIf patterns
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Mar 25, 2019, 21:40 UTC
- Message-ID
- <nycvar.QRO.7.76.6.1903252233580.41@tvgsbejvaqbjf.bet>
- In-Reply-To
- <20190324131755.26821-1-pclouds@gmail.com>
Hi Duy,
On Sun, 24 Mar 2019, Nguyễn Thái Ngọc Duy wrote:
Show 10 quoted lines
> 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
Show 14 quoted lines
> + 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 > >