Re: [PATCH] worktree: add per-worktree config files
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Sep 25, 2018, 15:57 UTC
- Message-ID
- <CACsJy8BFydQorJveGirFG4v3KLsF9bd3fALddJVU62BTF9UR2Q@mail.gmail.com>
- In-Reply-To
- <20180924142143.GD68796@syl>
On Mon, Sep 24, 2018 at 4:21 PM Taylor Blau <me@ttaylorr.com> wrote:
Show 16 quoted lines
> > +cmp_config() {
> > + if [ "$1" = "-C" ]; then
> > + shift &&
> > + GD="-C $1" &&
> > + shift
> > + else
> > + GD=
> > + fi &&
> > + echo "$1" >expected &&
> > + shift &&
> > + git $GD config "$@" >actual &&
> > + test_cmp expected actual
> > +}
>
> This cmp_config seems generally useful, perhaps beyond t2029. What do
> you think about putting it in t/test-lib-functions.sh instead?Good point. t1300 (and I think some t13xx) does the same. Other tests also do
test "$(git config...)" = blah
which can also use this function to have better error reporting when things go wrong.
-- Duy