From: Eric Sunshine Date: Fri, 02 Dec 2022 06:03:49 GMT Subject: Re: [PATCH v2 2/8] auto-crlf tests: check "git checkout" exit code Message-ID: In-Reply-To: <20221202055905.2rqp26xu4nuknlxw@tb-raspi4> On Fri, Dec 2, 2022 at 12:59 AM Torsten Bögershausen wrote: > On Fri, Dec 02, 2022 at 02:02:55AM +0100, René Scharfe wrote: > > Side note: The checkout commands only differ in their -c parameter. > > They could be unified like this, which might simplify handling their > > return code: > > > > git ${ceol:+-c core.eol=$ceol} checkout -- crlf_false_attr__$f.txt > > That is a nice one. (I learned about the ${:+} yesterday). > Is it supported by all the shells/os combinations ? ${:+} is well supported. It's POSIX. It's used heavily in the Git test suite already. So, it's safe to use.