From: Eric Sunshine Date: Sun, 26 Jul 2020 22:49:58 GMT Subject: Re: [PATCH v4 18/39] t8002: make hash size independent Message-ID: In-Reply-To: <20200726195424.626969-19-sandals@crustytoothpaste.net> On Sun, Jul 26, 2020 at 3:55 PM brian m. carlson wrote: > Compute the length of an object ID instead of of hard-coding 40-based s/of of /of/ > values. > > Signed-off-by: brian m. carlson > --- > diff --git a/t/t8002-blame.sh b/t/t8002-blame.sh > @@ -6,6 +6,10 @@ test_description='git blame' > +test_expect_success 'setup' ' > + test_oid_init > +' > + > @@ -105,17 +109,18 @@ test_expect_success 'blame --abbrev= works' ' > test_expect_success 'blame -l aligns regular and boundary commits' ' > + hexsz=$(test_oid hexsz) && > + check_abbrev $hexsz -l HEAD && > + check_abbrev $((hexsz - 1)) -l ^HEAD > ' > +test_expect_success 'blame --abbrev with full length behaves like -l' ' > + check_abbrev $hexsz --abbrev=$hexsz HEAD && > + check_abbrev $((hexsz - 1)) --abbrev=$hexsz ^HEAD > ' Rather than assigning 'hexsz' in the first test which needs the value and then re-using the value in subsequent tests, how about assigning 'hexsz' in the new "setup" test? This will make it easier to run individual tests while skipping others.