@matheusbsbs / matheus-bagliano / commits / 4a6f11fd7b
Fork 0

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>

Denton Liu committed Jan 6, 2020 at 23:53 UTC 4a6f11fd7be30a215b972a4d1dccd09ff146a36b
1 file changed +9 -9
t/t2018-checkout-branch.sh
+9 -9
@@ -4,12 +4,12 @@ test_description='checkout'
4
5 . ./test-lib.sh
6
7 -# Arguments: [!] <branch> <sha> [<checkout options>]
7 +# Arguments: [!] <branch> <oid> [<checkout options>]
8 #
9 # Runs "git checkout" to switch to <branch>, testing that
10 #
11 # 1) we are on the specified branch, <branch>;
12 -# 2) HEAD is <sha>; if <sha> is not specified, the old HEAD is used.
12 +# 2) HEAD is <oid>; if <oid> is not specified, the old HEAD is used.
13 #
14 # If <checkout options> is not specified, "git checkout" is run with -b.
15 #
@@ -25,8 +25,8 @@ do_checkout () {
25 exp_branch=$1 &&
26 exp_ref="refs/heads/$exp_branch" &&
27
28 - # if <sha> is not specified, use HEAD.
29 - exp_sha=${2:-$(git rev-parse --verify HEAD)} &&
28 + # if <oid> is not specified, use HEAD.
29 + exp_oid=${2:-$(git rev-parse --verify HEAD)} &&
30
31 # default options for git checkout: -b
32 if test -z "$3"
@@ -38,15 +38,15 @@ do_checkout () {
38
39 if test -n "$should_fail"
40 then
41 - test_must_fail git checkout $opts $exp_branch $exp_sha
41 + test_must_fail git checkout $opts $exp_branch $exp_oid
42 else
43 - git checkout $opts $exp_branch $exp_sha &&
43 + git checkout $opts $exp_branch $exp_oid &&
44 echo "$exp_ref" >ref.expect &&
45 git rev-parse --symbolic-full-name HEAD >ref.actual &&
46 test_cmp ref.expect ref.actual &&
47 - echo "$exp_sha" >sha.expect &&
48 - git rev-parse --verify HEAD >sha.actual &&
49 - test_cmp sha.expect sha.actual
47 + echo "$exp_oid" >oid.expect &&
48 + git rev-parse --verify HEAD >oid.actual &&
49 + test_cmp oid.expect oid.actual
50 fi
51 }
52