diff options
| author | Marc Pegon <pegon.marc@gmail.com> | 2011-05-28 21:24:25 +0200 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2011-06-01 23:40:41 +0200 |
| commit | ac2b94ad7658b53035b8518842348a083decd418 (patch) | |
| tree | 19c5220d8493f697a4f09557ca4dfafb6cc12b36 /src/odb_pack.c | |
| parent | dd453c4dbf9a1fa38530b1f51e079852736b8f66 (diff) | |
| download | libgit2-ac2b94ad7658b53035b8518842348a083decd418.tar.gz | |
Added a GIT_OID_MINPREFIXLEN constant to define the minimum length allowed for oid prefixes (set to 4, like in git). Consequently updated some object lookup methods and their documentation.
Diffstat (limited to 'src/odb_pack.c')
| -rw-r--r-- | src/odb_pack.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/odb_pack.c b/src/odb_pack.c index 605608314..070bde6e2 100644 --- a/src/odb_pack.c +++ b/src/odb_pack.c @@ -268,6 +268,8 @@ static off_t nth_packed_object_offset(const struct pack_file *p, uint32_t n); * a prefix of an identifier. * Throws GIT_EAMBIGUOUSOIDPREFIX if short oid * is ambiguous within the pack. + * This method assumes that len is between + * GIT_OID_MINPREFIXLEN and GIT_OID_HEXSZ. */ static int pack_entry_find_offset( off_t *offset_out, @@ -289,6 +291,8 @@ static int pack_entry_find(struct pack_entry *e, * a prefix of an identifier. * Throws GIT_EAMBIGUOUSOIDPREFIX if short oid * is ambiguous. + * This method assumes that len is between + * GIT_OID_MINPREFIXLEN and GIT_OID_HEXSZ. */ static int pack_entry_find_unique_short_oid(struct pack_entry *e, struct pack_backend *backend, |
