summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrodie Rao <brodie@bitheap.org>2011-10-11 22:05:12 -0700
committerBrodie Rao <brodie@bitheap.org>2011-10-12 17:34:04 -0700
commitb2a2702da2d714c20aa90194d0b670cd84c30b73 (patch)
tree84ea3faefabf78f01bd4cfb231cdbd6950f03ca9
parent3eaf34f4c602b9e155e2f4c6ae26c9250ac37d50 (diff)
downloadlibgit2-b2a2702da2d714c20aa90194d0b670cd84c30b73.tar.gz
odb_pack: don't do ambiguity checks for fully qualified SHA1 hashes
This makes libgit2 more closely match Git, which only checks for ambiguous pack entries when given short hashes. Note that the only time this is ever relevant is when a pack has the same object more than once (it's happened in the wild, I promise).
-rw-r--r--src/pack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pack.c b/src/pack.c
index 8de2d7814..2516bea93 100644
--- a/src/pack.c
+++ b/src/pack.c
@@ -722,7 +722,7 @@ static int pack_entry_find_offset(
}
}
- if (found && pos + 1 < (int)p->num_objects) {
+ if (found && len != GIT_OID_HEXSZ && pos + 1 < (int)p->num_objects) {
/* Check for ambiguousity */
const unsigned char *next = current + stride;