From: Eric Sunshine Date: Mon, 11 Jun 2018 07:59:21 GMT Subject: Re: [PATCH 03/10] t0002: abstract away SHA-1-specific constants Message-ID: In-Reply-To: <20180604235229.279814-4-sandals@crustytoothpaste.net> On Mon, Jun 4, 2018 at 7:52 PM, brian m. carlson wrote: > Adjust the test so that it computes variables for object IDs instead of > using hard-coded hashes. > > Signed-off-by: brian m. carlson > --- > diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh > @@ -89,14 +89,16 @@ test_expect_success 'enter_repo non-strict mode' ' > cd enter_repo && > test_tick && > test_commit foo && > + git rev-parse HEAD >head-revision && > mv .git .realgit && > echo "gitdir: .realgit" >.git > ) && > + head=$(cat enter_repo/head-revision) && Stashing the value temporarily in a file ("head-revision") is unnecessary and somewhat ugly. Just grab it directly after the subshell exits: ( cd enter_repo && ... ) && head=$(git -C enter_repo rev-parse HEAD) && ...