t: switch $_z40 to $ZERO_OID
Switch all uses of $_z40 to $ZERO_OID so that they work correctly with larger hashes. This commit was created by using the following sed command to modify all files in the t directory except t/test-lib.sh: sed -i 's/\$_z40/$ZERO_OID/g' Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
brian m. carlson committed
May 13, 2018 at 02:24 UTC
8125a58b912e52eba7889e1dba9fe6d711b0ffdf
32 files changed
+119
-119
t/t1006-cat-file.sh
+4
-4
@@ -236,8 +236,8 @@ test_expect_success "--batch-check for an empty line" '
236
'
237
238
test_expect_success 'empty --batch-check notices missing object' '
239
- echo "$_z40 missing" >expect &&
240
- echo "$_z40" | git cat-file --batch-check="" >actual &&
239
+ echo "$ZERO_OID missing" >expect &&
240
+ echo "$ZERO_OID" | git cat-file --batch-check="" >actual &&
241
test_cmp expect actual
242
'
243
@@ -294,8 +294,8 @@ test_expect_success 'setup blobs which are likely to delta' '
294
295
test_expect_success 'confirm that neither loose blob is a delta' '
296
cat >expect <<-EOF &&
297
- $_z40
298
- $_z40
297
+ $ZERO_OID
298
+ $ZERO_OID
299
EOF
300
git cat-file --batch-check="%(deltabase)" <blobs >actual &&
301
test_cmp expect actual
t/t1400-update-ref.sh
+1
-1
@@ -6,7 +6,7 @@
6
test_description='Test git update-ref and basic ref logging'
7
. ./test-lib.sh
8
9
-Z=$_z40
9
+Z=$ZERO_OID
10
11
m=refs/heads/master
12
n_dir=refs/heads/gu
t/t1407-worktree-ref-store.sh
+4
-4
@@ -50,13 +50,13 @@ test_expect_success 'create_symref(FOO, refs/heads/master)' '
50
'
51
52
test_expect_success 'for_each_reflog()' '
53
- echo $_z40 > .git/logs/PSEUDO-MAIN &&
53
+ echo $ZERO_OID > .git/logs/PSEUDO-MAIN &&
54
mkdir -p .git/logs/refs/bisect &&
55
- echo $_z40 > .git/logs/refs/bisect/random &&
55
+ echo $ZERO_OID > .git/logs/refs/bisect/random &&
56
57
- echo $_z40 > .git/worktrees/wt/logs/PSEUDO-WT &&
57
+ echo $ZERO_OID > .git/worktrees/wt/logs/PSEUDO-WT &&
58
mkdir -p .git/worktrees/wt/logs/refs/bisect &&
59
- echo $_z40 > .git/worktrees/wt/logs/refs/bisect/wt-random &&
59
+ echo $ZERO_OID > .git/worktrees/wt/logs/refs/bisect/wt-random &&
60
61
$RWT for-each-reflog | cut -c 42- | sort >actual &&
62
cat >expected <<-\EOF &&
t/t1450-fsck.sh
+2
-2
@@ -713,7 +713,7 @@ test_expect_success 'fsck notices dangling objects' '
713
714
test_expect_success 'fsck $name notices bogus $name' '
715
test_must_fail git fsck bogus &&
716
- test_must_fail git fsck $_z40
716
+ test_must_fail git fsck $ZERO_OID
717
'
718
719
test_expect_success 'bogus head does not fallback to all heads' '
@@ -723,7 +723,7 @@ test_expect_success 'bogus head does not fallback to all heads' '
723
blob=$(git rev-parse :foo) &&
724
test_when_finished "git rm --cached foo" &&
725
remove_object $blob &&
726
- test_must_fail git fsck $_z40 >out 2>&1 &&
726
+ test_must_fail git fsck $ZERO_OID >out 2>&1 &&
727
! grep $blob out
728
'
729
t/t1501-work-tree.sh
+3
-3
@@ -238,10 +238,10 @@ test_expect_success '_gently() groks relative GIT_DIR & GIT_WORK_TREE' '
238
239
test_expect_success 'diff-index respects work tree under .git dir' '
240
cat >diff-index-cached.expected <<-EOF &&
241
- :000000 100644 $_z40 $EMPTY_BLOB A sub/dir/tracked
241
+ :000000 100644 $ZERO_OID $EMPTY_BLOB A sub/dir/tracked
242
EOF
243
cat >diff-index.expected <<-EOF &&
244
- :000000 100644 $_z40 $_z40 A sub/dir/tracked
244
+ :000000 100644 $ZERO_OID $ZERO_OID A sub/dir/tracked
245
EOF
246
247
(
@@ -257,7 +257,7 @@ test_expect_success 'diff-index respects work tree under .git dir' '
257
258
test_expect_success 'diff-files respects work tree under .git dir' '
259
cat >diff-files.expected <<-EOF &&
260
- :100644 100644 $EMPTY_BLOB $_z40 M sub/dir/tracked
260
+ :100644 100644 $EMPTY_BLOB $ZERO_OID M sub/dir/tracked
261
EOF
262
263
(
t/t1601-index-bogus.sh
+1
-1
@@ -4,7 +4,7 @@ test_description='test handling of bogus index entries'
4
. ./test-lib.sh
5
6
test_expect_success 'create tree with null sha1' '
7
- tree=$(printf "160000 commit $_z40\\tbroken\\n" | git mktree)
7
+ tree=$(printf "160000 commit $ZERO_OID\\tbroken\\n" | git mktree)
8
'
9
10
test_expect_success 'read-tree refuses to read null sha1' '
t/t1700-split-index.sh
+1
-1
@@ -426,7 +426,7 @@ test_expect_success 'writing split index with null sha1 does not write cache tre
426
git commit -m "commit" &&
427
{
428
git ls-tree HEAD &&
429
- printf "160000 commit $_z40\\tbroken\\n"
429
+ printf "160000 commit $ZERO_OID\\tbroken\\n"
430
} >broken-tree &&
431
echo "add broken entry" >msg &&
432
t/t2011-checkout-invalid-head.sh
+1
-1
@@ -15,7 +15,7 @@ test_expect_success 'checkout should not start branch from a tree' '
15
'
16
17
test_expect_success 'checkout master from invalid HEAD' '
18
- echo $_z40 >.git/HEAD &&
18
+ echo $ZERO_OID >.git/HEAD &&
19
git checkout master --
20
'
21
t/t2025-worktree-add.sh
+4
-4
@@ -465,7 +465,7 @@ post_checkout_hook () {
465
test_expect_success '"add" invokes post-checkout hook (branch)' '
466
post_checkout_hook &&
467
{
468
- echo $_z40 $(git rev-parse HEAD) 1 &&
468
+ echo $ZERO_OID $(git rev-parse HEAD) 1 &&
469
echo $(pwd)/.git/worktrees/gumby &&
470
echo $(pwd)/gumby
471
} >hook.expect &&
@@ -476,7 +476,7 @@ test_expect_success '"add" invokes post-checkout hook (branch)' '
476
test_expect_success '"add" invokes post-checkout hook (detached)' '
477
post_checkout_hook &&
478
{
479
- echo $_z40 $(git rev-parse HEAD) 1 &&
479
+ echo $ZERO_OID $(git rev-parse HEAD) 1 &&
480
echo $(pwd)/.git/worktrees/grumpy &&
481
echo $(pwd)/grumpy
482
} >hook.expect &&
@@ -494,7 +494,7 @@ test_expect_success '"add --no-checkout" suppresses post-checkout hook' '
494
test_expect_success '"add" in other worktree invokes post-checkout hook' '
495
post_checkout_hook &&
496
{
497
- echo $_z40 $(git rev-parse HEAD) 1 &&
497
+ echo $ZERO_OID $(git rev-parse HEAD) 1 &&
498
echo $(pwd)/.git/worktrees/guppy &&
499
echo $(pwd)/guppy
500
} >hook.expect &&
@@ -506,7 +506,7 @@ test_expect_success '"add" in bare repo invokes post-checkout hook' '
506
rm -rf bare &&
507
git clone --bare . bare &&
508
{
509
- echo $_z40 $(git --git-dir=bare rev-parse HEAD) 1 &&
509
+ echo $ZERO_OID $(git --git-dir=bare rev-parse HEAD) 1 &&
510
echo $(pwd)/bare/worktrees/goozy &&
511
echo $(pwd)/goozy
512
} >hook.expect &&
t/t2027-worktree-list.sh
+1
-1
@@ -116,7 +116,7 @@ test_expect_success 'broken main worktree still at the top' '
116
git worktree add linked &&
117
cat >expected <<-EOF &&
118
worktree $(pwd)
119
- HEAD $_z40
119
+ HEAD $ZERO_OID
120
121
EOF
122
cd linked &&
t/t2107-update-index-basic.sh
+2
-2
@@ -37,7 +37,7 @@ test_expect_success '--cacheinfo does not accept blob null sha1' '
37
echo content >file &&
38
git add file &&
39
git rev-parse :file >expect &&
40
- test_must_fail git update-index --cacheinfo 100644 $_z40 file &&
40
+ test_must_fail git update-index --cacheinfo 100644 $ZERO_OID file &&
41
git rev-parse :file >actual &&
42
test_cmp expect actual
43
'
@@ -47,7 +47,7 @@ test_expect_success '--cacheinfo does not accept gitlink null sha1' '
47
(cd submodule && test_commit foo) &&
48
git add submodule &&
49
git rev-parse :submodule >expect &&
50
- test_must_fail git update-index --cacheinfo 160000 $_z40 submodule &&
50
+ test_must_fail git update-index --cacheinfo 160000 $ZERO_OID submodule &&
51
git rev-parse :submodule >actual &&
52
test_cmp expect actual
53
'
t/t2201-add-update-typechange.sh
+8
-8
@@ -75,35 +75,35 @@ test_expect_success modify '
75
git ls-tree -r HEAD |
76
sed -e "s/^/:/" -e "
77
/ caskly/{
78
- s/ caskly/ $_z40 D&/
78
+ s/ caskly/ $ZERO_OID D&/
79
s/blob/000000/
80
}
81
/ nitfol/{
82
- s/ nitfol/ $_z40 $T_letter&/
82
+ s/ nitfol/ $ZERO_OID $T_letter&/
83
s/blob/100644/
84
}
85
/ rezrov.bozbar/{
86
- s/ rezrov.bozbar/ $_z40 D&/
86
+ s/ rezrov.bozbar/ $ZERO_OID D&/
87
s/blob/000000/
88
}
89
/ xyzzy/{
90
- s/ xyzzy/ $_z40 D&/
90
+ s/ xyzzy/ $ZERO_OID D&/
91
s/blob/000000/
92
}
93
/ yomin/{
94
- s/ yomin/ $_z40 T&/
94
+ s/ yomin/ $ZERO_OID T&/
95
s/blob/160000/
96
}
97
"
98
} >expect &&
99
{
100
cat expect
101
- echo ":100644 160000 $_empty $_z40 T yonk"
102
- echo ":100644 000000 $_empty $_z40 D zifmia"
101
+ echo ":100644 160000 $_empty $ZERO_OID T yonk"
102
+ echo ":100644 000000 $_empty $ZERO_OID D zifmia"
103
} >expect-files &&
104
{
105
cat expect
106
- echo ":000000 160000 $_z40 $_z40 A yonk"
106
+ echo ":000000 160000 $ZERO_OID $ZERO_OID A yonk"
107
} >expect-index &&
108
{
109
echo "100644 $_empty 0 nitfol"
t/t2203-add-intent.sh
+3
-3
@@ -30,9 +30,9 @@ test_expect_success 'git status with porcelain v2' '
30
nam1=d00491fd7e5bb6fa28c517a0bb32b8b506539d4d &&
31
nam2=ce013625030ba8dba906f756967f9e9ca394464a &&
32
cat >expect <<-EOF &&
33
- 1 DA N... 100644 000000 100644 $nam1 $_z40 1.t
34
- 1 A. N... 000000 100644 100644 $_z40 $nam2 elif
35
- 1 .A N... 000000 000000 100644 $_z40 $_z40 file
33
+ 1 DA N... 100644 000000 100644 $nam1 $ZERO_OID 1.t
34
+ 1 A. N... 000000 100644 100644 $ZERO_OID $nam2 elif
35
+ 1 .A N... 000000 000000 100644 $ZERO_OID $ZERO_OID file
36
EOF
37
test_cmp expect actual
38
'
t/t3200-branch.sh
+2
-2
@@ -47,7 +47,7 @@ test_expect_success 'git branch HEAD should fail' '
47
'
48
49
cat >expect <<EOF
50
-$_z40 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 branch: Created from master
50
+$ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 branch: Created from master
51
EOF
52
test_expect_success 'git branch -l d/e/f should create a branch and a log' '
53
GIT_COMMITTER_DATE="2005-05-26 23:30" \
@@ -901,7 +901,7 @@ test_expect_success '--set-upstream-to notices an error to set branch as own ups
901
902
# Keep this test last, as it changes the current branch
903
cat >expect <<EOF
904
-$_z40 $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 branch: Created from master
904
+$ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 branch: Created from master
905
EOF
906
test_expect_success 'git checkout -b g/h/i -l should create a branch and a log' '
907
GIT_COMMITTER_DATE="2005-05-26 23:30" \
t/t4002-diff-basic.sh
+1
-1
@@ -131,7 +131,7 @@ cmp_diff_files_output () {
131
# object ID for the changed files because it wants you to look at the
132
# filesystem.
133
sed <"$2" >.test-tmp \
134
- -e '/^:000000 /d;s/'$_x40'\( [MCRNDU][0-9]*\) /'$_z40'\1 /' &&
134
+ -e '/^:000000 /d;s/'$_x40'\( [MCRNDU][0-9]*\) /'$ZERO_OID'\1 /' &&
135
test_cmp "$1" .test-tmp
136
}
137
t/t4014-format-patch.sh
+1
-1
@@ -1523,7 +1523,7 @@ test_expect_success 'cover letter auto user override' '
1523
test_expect_success 'format-patch --zero-commit' '
1524
git format-patch --zero-commit --stdout v2..v1 >patch2 &&
1525
grep "^From " patch2 | sort | uniq >actual &&
1526
- echo "From $_z40 Mon Sep 17 00:00:00 2001" >expect &&
1526
+ echo "From $ZERO_OID Mon Sep 17 00:00:00 2001" >expect &&
1527
test_cmp expect actual
1528
'
1529
t/t4020-diff-external.sh
+5
-5
@@ -26,7 +26,7 @@ test_expect_success 'GIT_EXTERNAL_DIFF environment' '
26
read path oldfile oldhex oldmode newfile newhex newmode &&
27
test "z$path" = zfile &&
28
test "z$oldmode" = z100644 &&
29
- test "z$newhex" = "z$_z40" &&
29
+ test "z$newhex" = "z$ZERO_OID" &&
30
test "z$newmode" = z100644 &&
31
oh=$(git rev-parse --verify HEAD:file) &&
32
test "z$oh" = "z$oldhex"
@@ -55,7 +55,7 @@ test_expect_success SYMLINKS 'typechange diff' '
55
read path oldfile oldhex oldmode newfile newhex newmode &&
56
test "z$path" = zfile &&
57
test "z$oldmode" = z100644 &&
58
- test "z$newhex" = "z$_z40" &&
58
+ test "z$newhex" = "z$ZERO_OID" &&
59
test "z$newmode" = z120000 &&
60
oh=$(git rev-parse --verify HEAD:file) &&
61
test "z$oh" = "z$oldhex"
@@ -73,7 +73,7 @@ test_expect_success 'diff.external' '
73
read path oldfile oldhex oldmode newfile newhex newmode &&
74
test "z$path" = zfile &&
75
test "z$oldmode" = z100644 &&
76
- test "z$newhex" = "z$_z40" &&
76
+ test "z$newhex" = "z$ZERO_OID" &&
77
test "z$newmode" = z100644 &&
78
oh=$(git rev-parse --verify HEAD:file) &&
79
test "z$oh" = "z$oldhex"
@@ -104,7 +104,7 @@ test_expect_success 'diff attribute' '
104
read path oldfile oldhex oldmode newfile newhex newmode &&
105
test "z$path" = zfile &&
106
test "z$oldmode" = z100644 &&
107
- test "z$newhex" = "z$_z40" &&
107
+ test "z$newhex" = "z$ZERO_OID" &&
108
test "z$newmode" = z100644 &&
109
oh=$(git rev-parse --verify HEAD:file) &&
110
test "z$oh" = "z$oldhex"
@@ -137,7 +137,7 @@ test_expect_success 'diff attribute' '
137
read path oldfile oldhex oldmode newfile newhex newmode &&
138
test "z$path" = zfile &&
139
test "z$oldmode" = z100644 &&
140
- test "z$newhex" = "z$_z40" &&
140
+ test "z$newhex" = "z$ZERO_OID" &&
141
test "z$newmode" = z100644 &&
142
oh=$(git rev-parse --verify HEAD:file) &&
143
test "z$oh" = "z$oldhex"
t/t4027-diff-submodule.sh
+3
-3
@@ -31,7 +31,7 @@ test_expect_success setup '
31
cd sub &&
32
git rev-list HEAD
33
) &&
34
- echo ":160000 160000 $3 $_z40 M sub" >expect &&
34
+ echo ":160000 160000 $3 $ZERO_OID M sub" >expect &&
35
subtip=$3 subprev=$2
36
'
37
@@ -250,7 +250,7 @@ test_expect_success 'conflicted submodule setup' '
250
# 39 efs
251
c=fffffffffffffffffffffffffffffffffffffff &&
252
(
253
- echo "000000 $_z40 0 sub" &&
253
+ echo "000000 $ZERO_OID 0 sub" &&
254
echo "160000 1$c 1 sub" &&
255
echo "160000 2$c 2 sub" &&
256
echo "160000 3$c 3 sub"
@@ -265,7 +265,7 @@ index 2ffffff,3ffffff..0000000
265
++Subproject commit 0000000000000000000000000000000000000000'\'' &&
266
267
hh=$(git rev-parse HEAD) &&
268
- sed -e "s/$_z40/$hh/" expect.nosub >expect.withsub
268
+ sed -e "s/$ZERO_OID/$hh/" expect.nosub >expect.withsub
269
270
'
271
t/t4046-diff-unmerged.sh
+7
-7
@@ -37,7 +37,7 @@ test_expect_success 'diff-files -0' '
37
for path in $paths
38
do
39
>"$path" &&
40
- echo ":000000 100644 $_z40 $_z40 U $path"
40
+ echo ":000000 100644 $ZERO_OID $ZERO_OID U $path"
41
done >diff-files-0.expect &&
42
git diff-files -0 >diff-files-0.actual &&
43
test_cmp diff-files-0.expect diff-files-0.actual
@@ -47,9 +47,9 @@ test_expect_success 'diff-files -1' '
47
for path in $paths
48
do
49
>"$path" &&
50
- echo ":000000 100644 $_z40 $_z40 U $path" &&
50
+ echo ":000000 100644 $ZERO_OID $ZERO_OID U $path" &&
51
case "$path" in
52
- x??) echo ":100644 100644 $blob1 $_z40 M $path"
52
+ x??) echo ":100644 100644 $blob1 $ZERO_OID M $path"
53
esac
54
done >diff-files-1.expect &&
55
git diff-files -1 >diff-files-1.actual &&
@@ -60,9 +60,9 @@ test_expect_success 'diff-files -2' '
60
for path in $paths
61
do
62
>"$path" &&
63
- echo ":000000 100644 $_z40 $_z40 U $path" &&
63
+ echo ":000000 100644 $ZERO_OID $ZERO_OID U $path" &&
64
case "$path" in
65
- ?x?) echo ":100644 100644 $blob2 $_z40 M $path"
65
+ ?x?) echo ":100644 100644 $blob2 $ZERO_OID M $path"
66
esac
67
done >diff-files-2.expect &&
68
git diff-files -2 >diff-files-2.actual &&
@@ -75,9 +75,9 @@ test_expect_success 'diff-files -3' '
75
for path in $paths
76
do
77
>"$path" &&
78
- echo ":000000 100644 $_z40 $_z40 U $path" &&
78
+ echo ":000000 100644 $ZERO_OID $ZERO_OID U $path" &&
79
case "$path" in
80
- ??x) echo ":100644 100644 $blob3 $_z40 M $path"
80
+ ??x) echo ":100644 100644 $blob3 $ZERO_OID M $path"
81
esac
82
done >diff-files-3.expect &&
83
git diff-files -3 >diff-files-3.actual &&
t/t4054-diff-bogus-tree.sh
+6
-6
@@ -19,37 +19,37 @@ test_expect_success 'create tree with matching file' '
19
'
20
21
test_expect_success 'raw diff shows null sha1 (addition)' '
22
- echo ":000000 100644 $_z40 $_z40 A foo" >expect &&
22
+ echo ":000000 100644 $ZERO_OID $ZERO_OID A foo" >expect &&
23
git diff-tree $EMPTY_TREE $bogus_tree >actual &&
24
test_cmp expect actual
25
'
26
27
test_expect_success 'raw diff shows null sha1 (removal)' '
28
- echo ":100644 000000 $_z40 $_z40 D foo" >expect &&
28
+ echo ":100644 000000 $ZERO_OID $ZERO_OID D foo" >expect &&
29
git diff-tree $bogus_tree $EMPTY_TREE >actual &&
30
test_cmp expect actual
31
'
32
33
test_expect_success 'raw diff shows null sha1 (modification)' '
34
- echo ":100644 100644 $blob $_z40 M foo" >expect &&
34
+ echo ":100644 100644 $blob $ZERO_OID M foo" >expect &&
35
git diff-tree $good_tree $bogus_tree >actual &&
36
test_cmp expect actual
37
'
38
39
test_expect_success 'raw diff shows null sha1 (other direction)' '
40
- echo ":100644 100644 $_z40 $blob M foo" >expect &&
40
+ echo ":100644 100644 $ZERO_OID $blob M foo" >expect &&
41
git diff-tree $bogus_tree $good_tree >actual &&
42
test_cmp expect actual
43
'
44
45
test_expect_success 'raw diff shows null sha1 (reverse)' '
46
- echo ":100644 100644 $_z40 $blob M foo" >expect &&
46
+ echo ":100644 100644 $ZERO_OID $blob M foo" >expect &&
47
git diff-tree -R $good_tree $bogus_tree >actual &&
48
test_cmp expect actual
49
'
50
51
test_expect_success 'raw diff shows null sha1 (index)' '
52
- echo ":100644 100644 $_z40 $blob M foo" >expect &&
52
+ echo ":100644 100644 $ZERO_OID $blob M foo" >expect &&
53
git diff-index $bogus_tree >actual &&
54
test_cmp expect actual
55
'
t/t4058-diff-duplicates.sh
+6
-6
@@ -59,12 +59,12 @@ test_expect_success 'create trees with duplicate entries' '
59
60
test_expect_success 'diff-tree between trees' '
61
{
62
- printf ":000000 100644 $_z40 $blob_two A\touter/inner\n" &&
63
- printf ":000000 100644 $_z40 $blob_two A\touter/inner\n" &&
64
- printf ":000000 100644 $_z40 $blob_two A\touter/inner\n" &&
65
- printf ":100644 000000 $blob_two $_z40 D\touter/inner\n" &&
66
- printf ":100644 000000 $blob_two $_z40 D\touter/inner\n" &&
67
- printf ":100644 000000 $blob_two $_z40 D\touter/inner\n"
62
+ printf ":000000 100644 $ZERO_OID $blob_two A\touter/inner\n" &&
63
+ printf ":000000 100644 $ZERO_OID $blob_two A\touter/inner\n" &&
64
+ printf ":000000 100644 $ZERO_OID $blob_two A\touter/inner\n" &&
65
+ printf ":100644 000000 $blob_two $ZERO_OID D\touter/inner\n" &&
66
+ printf ":100644 000000 $blob_two $ZERO_OID D\touter/inner\n" &&
67
+ printf ":100644 000000 $blob_two $ZERO_OID D\touter/inner\n"
68
} >expect &&
69
git diff-tree -r --no-abbrev one two >actual &&
70
test_cmp expect actual
t/t4150-am.sh
+2
-2
@@ -140,8 +140,8 @@ test_expect_success setup '
140
echo "# User $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL>" &&
141
echo "# Date $test_tick 25200" &&
142
echo "# $(git show --pretty="%aD" -s second)" &&
143
- echo "# Node ID $_z40" &&
144
- echo "# Parent $_z40" &&
143
+ echo "# Node ID $ZERO_OID" &&
144
+ echo "# Parent $ZERO_OID" &&
145
cat msg &&
146
echo &&
147
git diff-tree --no-commit-id -p second
t/t4200-rerere.sh
+1
-1
@@ -243,7 +243,7 @@ rerere_gc_custom_expiry_test () {
243
five_days="$1" right_now="$2"
244
test_expect_success "rerere gc with custom expiry ($five_days, $right_now)" '
245
rm -fr .git/rr-cache &&
246
- rr=.git/rr-cache/$_z40 &&
246
+ rr=.git/rr-cache/$ZERO_OID &&
247
mkdir -p "$rr" &&
248
>"$rr/preimage" &&
249
>"$rr/postimage" &&
t/t5516-fetch-push.sh
+11
-11
@@ -634,7 +634,7 @@ test_expect_success 'pushing valid refs triggers post-receive and post-update ho
634
orgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) &&
635
newmaster=$(git show-ref -s --verify refs/heads/master) &&
636
orgnext=$(cd testrepo && git show-ref -s --verify refs/heads/next) &&
637
- newnext=$_z40 &&
637
+ newnext=$ZERO_OID &&
638
git push testrepo refs/heads/master:refs/heads/master :refs/heads/next &&
639
(
640
cd testrepo/.git &&
@@ -672,15 +672,15 @@ test_expect_success 'deleting dangling ref triggers hooks with correct args' '
672
(
673
cd testrepo/.git &&
674
cat >pre-receive.expect <<-EOF &&
675
- $_z40 $_z40 refs/heads/master
675
+ $ZERO_OID $ZERO_OID refs/heads/master
676
EOF
677
678
cat >update.expect <<-EOF &&
679
- refs/heads/master $_z40 $_z40
679
+ refs/heads/master $ZERO_OID $ZERO_OID
680
EOF
681
682
cat >post-receive.expect <<-EOF &&
683
- $_z40 $_z40 refs/heads/master
683
+ $ZERO_OID $ZERO_OID refs/heads/master
684
EOF
685
686
cat >post-update.expect <<-EOF &&
@@ -703,12 +703,12 @@ test_expect_success 'deletion of a non-existent ref is not fed to post-receive a
703
cd testrepo/.git &&
704
cat >pre-receive.expect <<-EOF &&
705
$orgmaster $newmaster refs/heads/master
706
- $_z40 $_z40 refs/heads/nonexistent
706
+ $ZERO_OID $ZERO_OID refs/heads/nonexistent
707
EOF
708
709
cat >update.expect <<-EOF &&
710
refs/heads/master $orgmaster $newmaster
711
- refs/heads/nonexistent $_z40 $_z40
711
+ refs/heads/nonexistent $ZERO_OID $ZERO_OID
712
EOF
713
714
cat >post-receive.expect <<-EOF &&
@@ -732,11 +732,11 @@ test_expect_success 'deletion of a non-existent ref alone does trigger post-rece
732
(
733
cd testrepo/.git &&
734
cat >pre-receive.expect <<-EOF &&
735
- $_z40 $_z40 refs/heads/nonexistent
735
+ $ZERO_OID $ZERO_OID refs/heads/nonexistent
736
EOF
737
738
cat >update.expect <<-EOF &&
739
- refs/heads/nonexistent $_z40 $_z40
739
+ refs/heads/nonexistent $ZERO_OID $ZERO_OID
740
EOF
741
742
test_cmp pre-receive.expect pre-receive.actual &&
@@ -751,7 +751,7 @@ test_expect_success 'mixed ref updates, deletes, invalid deletes trigger hooks w
751
orgmaster=$(cd testrepo && git show-ref -s --verify refs/heads/master) &&
752
newmaster=$(git show-ref -s --verify refs/heads/master) &&
753
orgnext=$(cd testrepo && git show-ref -s --verify refs/heads/next) &&
754
- newnext=$_z40 &&
754
+ newnext=$ZERO_OID &&
755
orgpu=$(cd testrepo && git show-ref -s --verify refs/heads/pu) &&
756
newpu=$(git show-ref -s --verify refs/heads/master) &&
757
git push testrepo refs/heads/master:refs/heads/master \
@@ -763,14 +763,14 @@ test_expect_success 'mixed ref updates, deletes, invalid deletes trigger hooks w
763
$orgmaster $newmaster refs/heads/master
764
$orgnext $newnext refs/heads/next
765
$orgpu $newpu refs/heads/pu
766
- $_z40 $_z40 refs/heads/nonexistent
766
+ $ZERO_OID $ZERO_OID refs/heads/nonexistent
767
EOF
768
769
cat >update.expect <<-EOF &&
770
refs/heads/master $orgmaster $newmaster
771
refs/heads/next $orgnext $newnext
772
refs/heads/pu $orgpu $newpu
773
- refs/heads/nonexistent $_z40 $_z40
773
+ refs/heads/nonexistent $ZERO_OID $ZERO_OID
774
EOF
775
776
cat >post-receive.expect <<-EOF &&
t/t5527-fetch-odd-refs.sh
+1
-1
@@ -27,7 +27,7 @@ test_expect_success 'suffix ref is ignored during fetch' '
27
'
28
29
test_expect_success 'try to create repo with absurdly long refname' '
30
- ref240=$_z40/$_z40/$_z40/$_z40/$_z40/$_z40 &&
30
+ ref240=$ZERO_OID/$ZERO_OID/$ZERO_OID/$ZERO_OID/$ZERO_OID/$ZERO_OID &&
31
ref1440=$ref240/$ref240/$ref240/$ref240/$ref240/$ref240 &&
32
git init long &&
33
(
t/t5571-pre-push-hook.sh
+4
-4
@@ -78,8 +78,8 @@ test_expect_success 'push to default' '
78
cat >expected <<EOF
79
parent1
80
repo1
81
-refs/tags/one $COMMIT1 refs/tags/tag1 $_z40
82
-HEAD~ $COMMIT2 refs/heads/prev $_z40
81
+refs/tags/one $COMMIT1 refs/tags/tag1 $ZERO_OID
82
+HEAD~ $COMMIT2 refs/heads/prev $ZERO_OID
83
EOF
84
85
test_expect_success 'push non-branches' '
@@ -90,7 +90,7 @@ test_expect_success 'push non-branches' '
90
cat >expected <<EOF
91
parent1
92
repo1
93
-(delete) $_z40 refs/heads/prev $COMMIT2
93
+(delete) $ZERO_OID refs/heads/prev $COMMIT2
94
EOF
95
96
test_expect_success 'push delete' '
@@ -101,7 +101,7 @@ test_expect_success 'push delete' '
101
cat >expected <<EOF
102
repo1
103
repo1
104
-HEAD $COMMIT3 refs/heads/other $_z40
104
+HEAD $COMMIT3 refs/heads/other $ZERO_OID
105
EOF
106
107
test_expect_success 'push to URL' '
t/t6120-describe.sh
+1
-1
@@ -383,7 +383,7 @@ test_expect_success 'describe complains about tree object' '
383
'
384
385
test_expect_success 'describe complains about missing object' '
386
- test_must_fail git describe $_z40
386
+ test_must_fail git describe $ZERO_OID
387
'
388
389
test_done
t/t6300-for-each-ref.sh
+1
-1
@@ -310,7 +310,7 @@ test_expect_success 'exercise strftime with odd fields' '
310
echo >expected &&
311
git for-each-ref --format="%(authordate:format:)" refs/heads >actual &&
312
test_cmp expected actual &&
313
- long="long format -- $_z40$_z40$_z40$_z40$_z40$_z40$_z40" &&
313
+ long="long format -- $ZERO_OID$ZERO_OID$ZERO_OID$ZERO_OID$ZERO_OID$ZERO_OID$ZERO_OID" &&
314
echo $long >expected &&
315
git for-each-ref --format="%(authordate:format:$long)" refs/heads >actual &&
316
test_cmp expected actual
t/t6301-for-each-ref-errors.sh
+1
-1
@@ -4,7 +4,7 @@ test_description='for-each-ref errors for broken refs'
4
5
. ./test-lib.sh
6
7
-ZEROS=$_z40
7
+ZEROS=$ZERO_OID
8
MISSING=abababababababababababababababababababab
9
10
test_expect_success setup '
t/t7009-filter-branch-null-sha1.sh
+1
-1
@@ -12,7 +12,7 @@ test_expect_success 'setup: base commits' '
12
test_expect_success 'setup: a commit with a bogus null sha1 in the tree' '
13
{
14
git ls-tree HEAD &&
15
- printf "160000 commit $_z40\\tbroken\\n"
15
+ printf "160000 commit $ZERO_OID\\tbroken\\n"
16
} >broken-tree &&
17
echo "add broken entry" >msg &&
18
t/t7011-skip-worktree-reading.sh
+1
-1
@@ -118,7 +118,7 @@ test_expect_success 'grep with skip-worktree file' '
118
test "$(git grep --no-ext-grep test)" = "1:test"
119
'
120
121
-echo ":000000 100644 $_z40 $EMPTY_BLOB A 1" > expected
121
+echo ":000000 100644 $ZERO_OID $EMPTY_BLOB A 1" > expected
122
test_expect_success 'diff-index does not examine skip-worktree absent entries' '
123
setup_absent &&
124
git diff-index HEAD -- 1 > result &&
t/t7064-wtstatus-pv2.sh
+29
-29
@@ -46,11 +46,11 @@ test_expect_success 'before initial commit, things added' '
46
cat >expect <<-EOF &&
47
# branch.oid (initial)
48
# branch.head master
49
- 1 A. N... 000000 100644 100644 $_z40 $OID_A dir1/file_a
50
- 1 A. N... 000000 100644 100644 $_z40 $OID_B dir1/file_b
51
- 1 A. N... 000000 100644 100644 $_z40 $OID_X file_x
52
- 1 A. N... 000000 100644 100644 $_z40 $OID_Y file_y
53
- 1 A. N... 000000 100644 100644 $_z40 $OID_Z file_z
49
+ 1 A. N... 000000 100644 100644 $ZERO_OID $OID_A dir1/file_a
50
+ 1 A. N... 000000 100644 100644 $ZERO_OID $OID_B dir1/file_b
51
+ 1 A. N... 000000 100644 100644 $ZERO_OID $OID_X file_x
52
+ 1 A. N... 000000 100644 100644 $ZERO_OID $OID_Y file_y
53
+ 1 A. N... 000000 100644 100644 $ZERO_OID $OID_Z file_z
54
? actual
55
? expect
56
EOF
@@ -63,11 +63,11 @@ test_expect_success 'before initial commit, things added (-z)' '
63
lf_to_nul >expect <<-EOF &&
64
# branch.oid (initial)
65
# branch.head master
66
- 1 A. N... 000000 100644 100644 $_z40 $OID_A dir1/file_a
67
- 1 A. N... 000000 100644 100644 $_z40 $OID_B dir1/file_b
68
- 1 A. N... 000000 100644 100644 $_z40 $OID_X file_x
69
- 1 A. N... 000000 100644 100644 $_z40 $OID_Y file_y
70
- 1 A. N... 000000 100644 100644 $_z40 $OID_Z file_z
66
+ 1 A. N... 000000 100644 100644 $ZERO_OID $OID_A dir1/file_a
67
+ 1 A. N... 000000 100644 100644 $ZERO_OID $OID_B dir1/file_b
68
+ 1 A. N... 000000 100644 100644 $ZERO_OID $OID_X file_x
69
+ 1 A. N... 000000 100644 100644 $ZERO_OID $OID_Y file_y
70
+ 1 A. N... 000000 100644 100644 $ZERO_OID $OID_Z file_z
71
? actual
72
? expect
73
EOF
@@ -128,7 +128,7 @@ test_expect_success 'after first commit, stage existing changes' '
128
# branch.oid $H0
129
# branch.head master
130
1 M. N... 100644 100644 100644 $OID_X $OID_X1 file_x
131
- 1 D. N... 100644 000000 000000 $OID_Z $_z40 file_z
131
+ 1 D. N... 100644 000000 000000 $OID_Z $ZERO_OID file_z
132
? actual
133
? expect
134
EOF
@@ -145,7 +145,7 @@ test_expect_success 'rename causes 2 path lines' '
145
# branch.oid $H0
146
# branch.head master
147
1 M. N... 100644 100644 100644 $OID_X $OID_X1 file_x
148
- 1 D. N... 100644 000000 000000 $OID_Z $_z40 file_z
148
+ 1 D. N... 100644 000000 000000 $OID_Z $ZERO_OID file_z
149
2 R. N... 100644 100644 100644 $OID_Y $OID_Y R100 renamed_yQfile_y
150
? actual
151
? expect
@@ -163,7 +163,7 @@ test_expect_success 'rename causes 2 path lines (-z)' '
163
# branch.oid $H0
164
# branch.head master
165
1 M. N... 100644 100644 100644 $OID_X $OID_X1 file_x
166
- 1 D. N... 100644 000000 000000 $OID_Z $_z40 file_z
166
+ 1 D. N... 100644 000000 000000 $OID_Z $ZERO_OID file_z
167
2 R. N... 100644 100644 100644 $OID_Y $OID_Y R100 renamed_yQfile_y
168
? actual
169
? expect
@@ -246,8 +246,8 @@ test_expect_success 'verify --intent-to-add output' '
246
git add --intent-to-add intent1.add intent2.add &&
247
248
cat >expect <<-EOF &&
249
- 1 .A N... 000000 000000 100644 $_z40 $_z40 intent1.add
250
- 1 .A N... 000000 000000 100644 $_z40 $_z40 intent2.add
249
+ 1 .A N... 000000 000000 100644 $ZERO_OID $ZERO_OID intent1.add
250
+ 1 .A N... 000000 000000 100644 $ZERO_OID $ZERO_OID intent2.add
251
EOF
252
253
git status --porcelain=v2 >actual &&
@@ -280,7 +280,7 @@ test_expect_success 'verify AA (add-add) conflict' '
280
cat >expect <<-EOF &&
281
# branch.oid $HM
282
# branch.head AA_M
283
- u AA N... 000000 100644 100644 100644 $_z40 $OID_AA_B $OID_AA_A conflict.txt
283
+ u AA N... 000000 100644 100644 100644 $ZERO_OID $OID_AA_B $OID_AA_A conflict.txt
284
EOF
285
286
git status --porcelain=v2 --branch --untracked-files=all >actual &&
@@ -373,7 +373,7 @@ test_expect_success 'verify upstream fields in branch header' '
373
## Test upstream-gone case. Fake this by pointing origin/master at
374
## a non-existing commit.
375
OLD=$(git rev-parse origin/master) &&
376
- NEW=$_z40 &&
376
+ NEW=$ZERO_OID &&
377
mv .git/packed-refs .git/old-packed-refs &&
378
sed "s/$OLD/$NEW/g" <.git/old-packed-refs >.git/packed-refs &&
379
@@ -469,8 +469,8 @@ test_expect_success 'create and add submodule, submodule appears clean (A. S...)
469
# branch.head master
470
# branch.upstream origin/master
471
# branch.ab +0 -0
472
- 1 A. N... 000000 100644 100644 $_z40 $HMOD .gitmodules
473
- 1 A. S... 000000 160000 160000 $_z40 $HSUB sub1
472
+ 1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
473
+ 1 A. S... 000000 160000 160000 $ZERO_OID $HSUB sub1
474
EOF
475
476
git status --porcelain=v2 --branch --untracked-files=all >actual &&
@@ -494,8 +494,8 @@ test_expect_success 'untracked changes in added submodule (AM S..U)' '
494
# branch.head master
495
# branch.upstream origin/master
496
# branch.ab +0 -0
497
- 1 A. N... 000000 100644 100644 $_z40 $HMOD .gitmodules
498
- 1 AM S..U 000000 160000 160000 $_z40 $HSUB sub1
497
+ 1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
498
+ 1 AM S..U 000000 160000 160000 $ZERO_OID $HSUB sub1
499
EOF
500
501
git status --porcelain=v2 --branch --untracked-files=all >actual &&
@@ -519,8 +519,8 @@ test_expect_success 'staged changes in added submodule (AM S.M.)' '
519
# branch.head master
520
# branch.upstream origin/master
521
# branch.ab +0 -0
522
- 1 A. N... 000000 100644 100644 $_z40 $HMOD .gitmodules
523
- 1 AM S.M. 000000 160000 160000 $_z40 $HSUB sub1
522
+ 1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
523
+ 1 AM S.M. 000000 160000 160000 $ZERO_OID $HSUB sub1
524
EOF
525
526
git status --porcelain=v2 --branch --untracked-files=all >actual &&
@@ -546,8 +546,8 @@ test_expect_success 'staged and unstaged changes in added (AM S.M.)' '
546
# branch.head master
547
# branch.upstream origin/master
548
# branch.ab +0 -0
549
- 1 A. N... 000000 100644 100644 $_z40 $HMOD .gitmodules
550
- 1 AM S.M. 000000 160000 160000 $_z40 $HSUB sub1
549
+ 1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
550
+ 1 AM S.M. 000000 160000 160000 $ZERO_OID $HSUB sub1
551
EOF
552
553
git status --porcelain=v2 --branch --untracked-files=all >actual &&
@@ -573,8 +573,8 @@ test_expect_success 'staged and untracked changes in added submodule (AM S.MU)'
573
# branch.head master
574
# branch.upstream origin/master
575
# branch.ab +0 -0
576
- 1 A. N... 000000 100644 100644 $_z40 $HMOD .gitmodules
577
- 1 AM S.MU 000000 160000 160000 $_z40 $HSUB sub1
576
+ 1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
577
+ 1 AM S.MU 000000 160000 160000 $ZERO_OID $HSUB sub1
578
EOF
579
580
git status --porcelain=v2 --branch --untracked-files=all >actual &&
@@ -600,8 +600,8 @@ test_expect_success 'commit within the submodule appears as new commit in super
600
# branch.head master
601
# branch.upstream origin/master
602
# branch.ab +0 -0
603
- 1 A. N... 000000 100644 100644 $_z40 $HMOD .gitmodules
604
- 1 AM SC.. 000000 160000 160000 $_z40 $HSUB sub1
603
+ 1 A. N... 000000 100644 100644 $ZERO_OID $HMOD .gitmodules
604
+ 1 AM SC.. 000000 160000 160000 $ZERO_OID $HSUB sub1
605
EOF
606
607
git status --porcelain=v2 --branch --untracked-files=all >actual &&