Re: [PATCH] Add new @ shortcut for HEAD
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:57:04
Felipe Contreras [off-list ref] writes:
quoted hunk
diff --git a/t/t1503-rev-parse-verify.sh b/t/t1503-rev-parse-verify.sh index 813cc1b..426c63f 100755 --- a/t/t1503-rev-parse-verify.sh +++ b/t/t1503-rev-parse-verify.sh@@ -115,4 +115,13 @@ test_expect_success 'master@{n} for various n' ' test_must_fail git rev-parse --verify master@{$Np1} ' +test_expect_success 'empty @' ' + rev_hash=$(git rev-parse --verify @) && + test "$rev_hash" = "$HASH4" && + rev_hash=$(git rev-parse --verify HEAD@) && + test "$rev_hash" = "$HASH4" && + rev_hash=$(git rev-parse --verify master@) && + test "$rev_hash" = "$HASH4" +'
Don't we have different refs that resolve to something other than
$HASH4 at this point in the test? Otherwise we wouldn't notice a
breakage because we cannot tell if HEAD@ and master@ are interpreted
correctly or all of these happen to yield $HASH4 because a version
somebody else patches to break the implementation in this patch
discards any string before @ that is not followed by {stuff}.