On Sun, Jul 26, 2020 at 3:55 PM brian m. carlson <sandals@xxxxxxxxxxxxxxxxxxxx> 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 <sandals@xxxxxxxxxxxxxxxxxxxx> > --- > 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=<n> 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.