From: Eric Sunshine Date: Tue, 10 May 2016 06:34:30 GMT Subject: Re: [PATCH 4/6] t1500: avoid setting configuration options outside of tests Message-ID: In-Reply-To: <20160510052055.32924-5-sunshine@sunshineco.com> On Tue, May 10, 2016 at 1:20 AM, Eric Sunshine wrote: > Ideally, each test should be responsible for setting up state it needs > rather than relying upon transient global state. Toward this end, teach > test_rev_parse() to accept a "-b " option to allow callers to set > "core.bare" explicitly or undefine it, and take advantage of this new > option to avoid setting "core.bare" outside of tests. > [...snip...] > > Signed-off-by: Eric Sunshine > --- > diff --git a/t/t1500-rev-parse.sh b/t/t1500-rev-parse.sh > @@ -6,15 +6,25 @@ test_description='test git rev-parse' > + case "$bare" in > + '') ;; > + t*) bare="test_config $dir core.bare true" ;; > + f*) bare="test_config $dir core.bare false" ;; > + u*) bare="test_unconfig $dir core.bare" ;; > + *) error "test_rev_parse: unrecognized core.bare value '$bare'" Oops, this line lost its ;; at some point while refining the code. > + esac > +