Skip to content

Commit c054d64

Browse files
author
Junio C Hamano
committed
Revert "get_sha1_basic(): corner case ambiguity fix"
This reverts 6677c46 commit. The misguided disambiguation has been reverted, so there is no point testing that misfeature.
1 parent f7087e2 commit c054d64

File tree

2 files changed

+1
-49
lines changed

2 files changed

+1
-49
lines changed

sha1_name.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ static int ambiguous_path(const char *path, int len)
223223
slash = 0;
224224
continue;
225225
}
226-
return slash;
226+
break;
227227
}
228228
return slash;
229229
}

t/t0000-basic.sh

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -205,52 +205,4 @@ test_expect_success \
205205
'no diff after checkout and git-update-index --refresh.' \
206206
'git-diff-files >current && cmp -s current /dev/null'
207207

208-
209-
# extended sha1 parsing and ambiguity resolution
210-
211-
GIT_AUTHOR_DATE='1995-01-29T16:00:00 -0800'
212-
213-
GIT_AUTHOR_NAME='A U Thor'
214-
GIT_COMMITTER_DATE='1995-01-29T16:00:00 -0800'
215-
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-
256208
test_done

0 commit comments

Comments
 (0)