Revert "get_sha1_basic(): corner case ambiguity fix"
This reverts 6677c4665af2d73f670bec382bc82d0f2e9513fb commit. The misguided disambiguation has been reverted, so there is no point testing that misfeature.
Junio C Hamano committed
Dec 17, 2005 at 00:00 UTC
c054d64e8783e5ac2fa68c382f00df9087bca0f9
2 files changed
+1
-49
sha1_name.c
+1
-1
@@ -223,7 +223,7 @@ static int ambiguous_path(const char *path, int len)
223
slash = 0;
224
continue;
225
}
226
- return slash;
226
+ break;
227
}
228
return slash;
229
}
t/t0000-basic.sh
-48
@@ -205,52 +205,4 @@ test_expect_success \
205
'no diff after checkout and git-update-index --refresh.' \
206
'git-diff-files >current && cmp -s current /dev/null'
207
208
-
209
-# extended sha1 parsing and ambiguity resolution
210
-
211
-GIT_AUTHOR_DATE='1995-01-29T16:00:00 -0800'
212
-GIT_AUTHOR_EMAIL=a.u.thor@example.com
213
-GIT_AUTHOR_NAME='A U Thor'
214
-GIT_COMMITTER_DATE='1995-01-29T16:00:00 -0800'
215
-GIT_COMMITTER_EMAIL=c.o.mmitter@example.com
216
-GIT_COMMITTER_NAME='C O Mmitter'
217
-export GIT_AUTHOR_DATE
218
-export GIT_AUTHOR_EMAIL
219
-export GIT_AUTHOR_NAME
220
-export GIT_COMMITTER_DATE
221
-export GIT_COMMITTER_EMAIL
222
-export GIT_COMMITTER_NAME
223
-
224
-test_expect_success \
225
- 'initial commit.' \
226
- 'commit=$(echo Initial commit | git-commit-tree $tree) &&
227
- echo "$commit" >.git/refs/heads/master &&
228
- git-ls-tree HEAD &&
229
- test "$commit" = 51a092e9ef6cbbe66d258acd17599d3f80be6162'
230
-
231
-test_expect_success \
232
- 'Ambiguous' \
233
- 'echo "$commit" >.git/refs/heads/nasty &&
234
- echo "$commit" >.git/refs/tags/nasty &&
235
- if git-rev-parse --verify nasty
236
- then
237
- echo "should have barfed"
238
- false
239
- else
240
- :
241
- fi &&
242
- # names directly underneath .git/ should not interfere
243
- echo "$commit" >.git/refs/heads/description &&
244
- git-rev-parse --verify description &&
245
- # broken object name
246
- echo fffffffffffffffffffffffffffffffffffffffg \
247
- >.git/refs/heads/nasty &&
248
- if git-rev-parse --verify nasty
249
- then
250
- echo "should have barfed"
251
- false
252
- else
253
- :
254
- fi'
255
-
208
test_done