Re: [PATCH] config.c: fix regression for core.safecrlf false
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Jun 6, 2018, 17:15 UTC
- Message-ID
- <CAPig+cSzJ=2Zz7jRNB7sK7FyZ+YwdAFseCTSDbM_m4E8K9WxHA@mail.gmail.com>
- In-Reply-To
- <20180604201742.18992-1-asottile@umich.edu>
On Mon, Jun 4, 2018 at 4:17 PM, Anthony Sottile <asottile@umich.edu> wrote:
Show 10 quoted lines
> A regression introduced in 8462ff43e42ab67cecd16fdfb59451a53cc8a945 caused > autocrlf rewrites to produce a warning message despite setting safecrlf=false. > > Signed-off-by: Anthony Sottile <asottile@umich.edu> > --- > diff --git a/t/t0020-crlf.sh b/t/t0020-crlf.sh > @@ -98,6 +98,16 @@ test_expect_success 'safecrlf: git diff demotes safecrlf=true to warn' ' > +test_expect_success 'safecrlf: no warning with safecrlf=false' ' > + git config core.autocrlf input && > + git config core.safecrlf false &&
I was going to suggest test_config() for these rather than bare git-config, but I see other tests in this file already use the bare form, so this is following existing practice.
> + for w in I am all CRLF; do echo $w; done | append_cr >allcrlf &&
Simpler: printf "%s\n" I am all CRLF | append_cr >allcrlf &&
(probably not worth a re-roll)
> + git add allcrlf 2>err && > + test_must_be_empty err > +'