File tree Expand file tree Collapse file tree 6 files changed +11
-13
lines changed Expand file tree Collapse file tree 6 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -834,7 +834,7 @@ test_expect_success 'git write-tree should be able to write an empty tree' '
834
834
'
835
835
836
836
test_expect_success ' validate object ID of a known tree' '
837
- test "$tree" = 4b825dc642cb6eb9a060e54bf8d69288fbee4904
837
+ test "$tree" = $EMPTY_TREE
838
838
'
839
839
840
840
# Various types of objects
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ Also make sure that command line parser understands the normal
15
15
. ./test-lib.sh
16
16
17
17
cat > expected << EOF
18
- tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
18
+ tree $EMPTY_TREE
19
19
author Author Name <author@email> 1117148400 +0000
20
20
committer Committer Name <committer@email> 1117150200 +0000
21
21
Original file line number Diff line number Diff line change @@ -78,8 +78,6 @@ test_expect_success 'diff-tree pathspec' '
78
78
test_cmp expected current
79
79
'
80
80
81
- EMPTY_TREE=4b825dc642cb6eb9a060e54bf8d69288fbee4904
82
-
83
81
test_expect_success ' diff-tree with wildcard shows dir also matches' '
84
82
git diff-tree --name-only $EMPTY_TREE $tree -- "f*" >result &&
85
83
echo file0 >expected &&
Original file line number Diff line number Diff line change 3
3
test_description=' test diff with a bogus tree containing the null sha1'
4
4
. ./test-lib.sh
5
5
6
- empty_tree=4b825dc642cb6eb9a060e54bf8d69288fbee4904
7
-
8
6
test_expect_success ' create bogus tree' '
9
7
bogus_tree=$(
10
8
printf "100644 fooQQQQQQQQQQQQQQQQQQQQQ" |
@@ -22,13 +20,13 @@ test_expect_success 'create tree with matching file' '
22
20
23
21
test_expect_success ' raw diff shows null sha1 (addition)' '
24
22
echo ":000000 100644 $_z40 $_z40 A foo" >expect &&
25
- git diff-tree $empty_tree $bogus_tree >actual &&
23
+ git diff-tree $EMPTY_TREE $bogus_tree >actual &&
26
24
test_cmp expect actual
27
25
'
28
26
29
27
test_expect_success ' raw diff shows null sha1 (removal)' '
30
28
echo ":100644 000000 $_z40 $_z40 D foo" >expect &&
31
- git diff-tree $bogus_tree $empty_tree >actual &&
29
+ git diff-tree $bogus_tree $EMPTY_TREE >actual &&
32
30
test_cmp expect actual
33
31
'
34
32
@@ -57,11 +55,11 @@ test_expect_success 'raw diff shows null sha1 (index)' '
57
55
'
58
56
59
57
test_expect_success ' patch fails due to bogus sha1 (addition)' '
60
- test_must_fail git diff-tree -p $empty_tree $bogus_tree
58
+ test_must_fail git diff-tree -p $EMPTY_TREE $bogus_tree
61
59
'
62
60
63
61
test_expect_success ' patch fails due to bogus sha1 (removal)' '
64
- test_must_fail git diff-tree -p $bogus_tree $empty_tree
62
+ test_must_fail git diff-tree -p $bogus_tree $EMPTY_TREE
65
63
'
66
64
67
65
test_expect_success ' patch fails due to bogus sha1 (modification)' '
Original file line number Diff line number Diff line change @@ -115,8 +115,8 @@ test_expect_success 'push with transfer.fsckobjects' '
115
115
test_cmp exp act
116
116
'
117
117
118
- cat > bogus-commit << \ EOF
119
- tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
118
+ cat > bogus-commit << EOF
119
+ tree $EMPTY_TREE
120
120
author Bugs Bunny 1234567890 +0000
121
121
committer Bugs Bunny <[email protected] > 1234567890 +0000
122
122
Original file line number Diff line number Diff line change @@ -162,6 +162,8 @@ _x40="$_x05$_x05$_x05$_x05$_x05$_x05$_x05$_x05"
162
162
# Zero SHA-1
163
163
_z40=0000000000000000000000000000000000000000
164
164
165
+ EMPTY_TREE=4b825dc642cb6eb9a060e54bf8d69288fbee4904
166
+
165
167
# Line feed
166
168
LF='
167
169
'
170
172
# when case-folding filenames
171
173
u200c=$( printf ' \342\200\214' )
172
174
173
- export _x05 _x40 _z40 LF u200c
175
+ export _x05 _x40 _z40 LF u200c EMPTY_TREE
174
176
175
177
# Each test should start with something like this, after copyright notices:
176
178
#
You can’t perform that action at this time.
0 commit comments