summaryrefslogtreecommitdiff
path: root/t/t2018-checkout-branch.sh
diff options
context:
space:
mode:
authorDenton Liu <liu.denton@gmail.com>2020-01-07 04:53:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-01-27 20:56:02 (GMT)
commit4a6f11fd7be30a215b972a4d1dccd09ff146a36b (patch)
treef9554ba23f4a43e5b580b24c7535a8bd64f8eb3d /t/t2018-checkout-branch.sh
parent62e80fcb480d388777a9d6d96d977e02c3e7dd36 (diff)
downloadgit-4a6f11fd7be30a215b972a4d1dccd09ff146a36b.zip
git-4a6f11fd7be30a215b972a4d1dccd09ff146a36b.tar.gz
git-4a6f11fd7be30a215b972a4d1dccd09ff146a36b.tar.bz2
t2018: replace "sha" with "oid"
As part of the effort to become more hash-agnostic, replace all instances of "sha" with "oid". Signed-off-by: Denton Liu <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2018-checkout-branch.sh')
-rwxr-xr-xt/t2018-checkout-branch.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/t/t2018-checkout-branch.sh b/t/t2018-checkout-branch.sh
index caf4357..bbca7ef 100755
--- a/t/t2018-checkout-branch.sh
+++ b/t/t2018-checkout-branch.sh
@@ -4,12 +4,12 @@ test_description='checkout'
. ./test-lib.sh
-# Arguments: [!] <branch> <sha> [<checkout options>]
+# Arguments: [!] <branch> <oid> [<checkout options>]
#
# Runs "git checkout" to switch to <branch>, testing that
#
# 1) we are on the specified branch, <branch>;
-# 2) HEAD is <sha>; if <sha> is not specified, the old HEAD is used.
+# 2) HEAD is <oid>; if <oid> is not specified, the old HEAD is used.
#
# If <checkout options> is not specified, "git checkout" is run with -b.
#
@@ -25,8 +25,8 @@ do_checkout () {
exp_branch=$1 &&
exp_ref="refs/heads/$exp_branch" &&
- # if <sha> is not specified, use HEAD.
- exp_sha=${2:-$(git rev-parse --verify HEAD)} &&
+ # if <oid> is not specified, use HEAD.
+ exp_oid=${2:-$(git rev-parse --verify HEAD)} &&
# default options for git checkout: -b
if test -z "$3"
@@ -38,15 +38,15 @@ do_checkout () {
if test -n "$should_fail"
then
- test_must_fail git checkout $opts $exp_branch $exp_sha
+ test_must_fail git checkout $opts $exp_branch $exp_oid
else
- git checkout $opts $exp_branch $exp_sha &&
+ git checkout $opts $exp_branch $exp_oid &&
echo "$exp_ref" >ref.expect &&
git rev-parse --symbolic-full-name HEAD >ref.actual &&
test_cmp ref.expect ref.actual &&
- echo "$exp_sha" >sha.expect &&
- git rev-parse --verify HEAD >sha.actual &&
- test_cmp sha.expect sha.actual
+ echo "$exp_oid" >oid.expect &&
+ git rev-parse --verify HEAD >oid.actual &&
+ test_cmp oid.expect oid.actual
fi
}