@@ -77,6 +77,7 @@ test_expect_success 'disambiguate blob' '
77
77
78
78
test_expect_success ' disambiguate tree' '
79
79
commit=$(echo "d7xm" | git commit-tree 000000000) &&
80
+ # this commit is fffff2e and not ambiguous with the 00000* objects
80
81
test $(git rev-parse $commit^{tree}) = $(git rev-parse 0000000000cdc)
81
82
'
82
83
@@ -99,10 +100,14 @@ test_expect_success 'disambiguate commit-ish' '
99
100
100
101
test_expect_success ' disambiguate commit' '
101
102
commit=$(echo "hoaxj" | git commit-tree 0000000000cdc -p 000000000) &&
103
+ # this commit is ffffffd8 and not ambiguous with the 00000* objects
102
104
test $(git rev-parse $commit^) = $(git rev-parse 0000000000e4f)
103
105
'
104
106
105
107
test_expect_success ' log name1..name2 takes only commit-ishes on both ends' '
108
+ # These are underspecified from the prefix-length point of view
109
+ # to disambiguate the commit with other objects, but there is only
110
+ # one commit that has 00000* prefix at this point.
106
111
git log 000000000..000000000 &&
107
112
git log ..000000000 &&
108
113
git log 000000000.. &&
@@ -112,16 +117,19 @@ test_expect_success 'log name1..name2 takes only commit-ishes on both ends' '
112
117
'
113
118
114
119
test_expect_success ' rev-parse name1..name2 takes only commit-ishes on both ends' '
120
+ # Likewise.
115
121
git rev-parse 000000000..000000000 &&
116
122
git rev-parse ..000000000 &&
117
123
git rev-parse 000000000..
118
124
'
119
125
120
126
test_expect_success ' git log takes only commit-ish' '
127
+ # Likewise.
121
128
git log 000000000
122
129
'
123
130
124
131
test_expect_success ' git reset takes only commit-ish' '
132
+ # Likewise.
125
133
git reset 000000000
126
134
'
127
135
@@ -131,26 +139,30 @@ test_expect_success 'first tag' '
131
139
'
132
140
133
141
test_expect_failure ' two semi-ambiguous commit-ish' '
142
+ # At this point, we have a tag 0000000000f8f that points
143
+ # at a commit 0000000000e4f, and a tree and a blob that
144
+ # share 0000000000 prefix with these tag and commit.
145
+ #
134
146
# Once the parser becomes ultra-smart, it could notice that
135
- # 110282 before ^{commit} name many different objects, but
147
+ # 0000000000 before ^{commit} name many different objects, but
136
148
# that only two (HEAD and v1.0.0 tag) can be peeled to commit,
137
149
# and that peeling them down to commit yield the same commit
138
150
# without ambiguity.
139
- git rev-parse --verify 110282 ^{commit} &&
151
+ git rev-parse --verify 0000000000 ^{commit} &&
140
152
141
153
# likewise
142
- git log 000000000..000000000 &&
143
- git log ..000000000 &&
144
- git log 000000000 .. &&
145
- git log 000000000 ...000000000 &&
146
- git log ...000000000 &&
147
- git log 000000000 ...
154
+ git log 0000000000..0000000000 &&
155
+ git log ..0000000000 &&
156
+ git log 0000000000 .. &&
157
+ git log 0000000000 ...0000000000 &&
158
+ git log ...0000000000 &&
159
+ git log 0000000000 ...
148
160
'
149
161
150
162
test_expect_failure ' three semi-ambiguous tree-ish' '
151
163
# Likewise for tree-ish. HEAD, v1.0.0 and HEAD^{tree} share
152
164
# the prefix but peeling them to tree yields the same thing
153
- git rev-parse --verify 000000000 ^{tree}
165
+ git rev-parse --verify 0000000000 ^{tree}
154
166
'
155
167
156
168
test_expect_success ' parse describe name' '
@@ -241,7 +253,7 @@ test_expect_success 'ambiguous commit-ish' '
241
253
# Now there are many commits that begin with the
242
254
# common prefix, none of these should pick one at
243
255
# random. They all should result in ambiguity errors.
244
- test_must_fail git rev-parse --verify 110282 ^{commit} &&
256
+ test_must_fail git rev-parse --verify 00000000 ^{commit} &&
245
257
246
258
# likewise
247
259
test_must_fail git log 000000000..000000000 &&
0 commit comments