Skip to content

Commit cc80c95

Browse files
peffgitster
authored andcommitted
t5304: rename "sha1" variables to "oid"
Let's make the script less jarring to read in a post-sha1 world by using more hash-agnostic variable names. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c2bf473 commit cc80c95

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

t/t5304-prune.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ test_expect_success 'prune: do not prune detached HEAD with no reflog' '
118118

119119
test_expect_success 'prune: prune former HEAD after checking out branch' '
120120
121-
head_sha1=$(git rev-parse HEAD) &&
121+
head_oid=$(git rev-parse HEAD) &&
122122
git checkout --quiet master &&
123123
git prune -v >prune_actual &&
124-
grep "$head_sha1" prune_actual
124+
grep "$head_oid" prune_actual
125125
126126
'
127127

@@ -265,24 +265,24 @@ EOF
265265
'
266266

267267
test_expect_success 'prune .git/shallow' '
268-
SHA1=$(echo hi|git commit-tree HEAD^{tree}) &&
269-
echo $SHA1 >.git/shallow &&
268+
oid=$(echo hi|git commit-tree HEAD^{tree}) &&
269+
echo $oid >.git/shallow &&
270270
git prune --dry-run >out &&
271-
grep $SHA1 .git/shallow &&
272-
grep $SHA1 out &&
271+
grep $oid .git/shallow &&
272+
grep $oid out &&
273273
git prune &&
274274
test_path_is_missing .git/shallow
275275
'
276276

277277
test_expect_success 'prune .git/shallow when there are no loose objects' '
278-
SHA1=$(echo hi|git commit-tree HEAD^{tree}) &&
279-
echo $SHA1 >.git/shallow &&
280-
git update-ref refs/heads/shallow-tip $SHA1 &&
278+
oid=$(echo hi|git commit-tree HEAD^{tree}) &&
279+
echo $oid >.git/shallow &&
280+
git update-ref refs/heads/shallow-tip $oid &&
281281
git repack -ad &&
282282
# verify assumption that all loose objects are gone
283283
git count-objects | grep ^0 &&
284284
git prune &&
285-
echo $SHA1 >expect &&
285+
echo $oid >expect &&
286286
test_cmp expect .git/shallow
287287
'
288288

@@ -326,8 +326,8 @@ test_expect_success 'prune: handle HEAD reflog in multiple worktrees' '
326326
git reset --hard HEAD^
327327
) &&
328328
git prune --expire=now &&
329-
SHA1=`git hash-object expected` &&
330-
git -C third-worktree show "$SHA1" >actual &&
329+
oid=`git hash-object expected` &&
330+
git -C third-worktree show "$oid" >actual &&
331331
test_cmp expected actual
332332
'
333333

0 commit comments

Comments
 (0)