diff options
author | Marc Pegon <pegon.marc@gmail.com> | 2011-05-27 18:49:09 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-06-01 23:40:41 +0200 |
commit | ecd6fdf1f70b785f24e2d17bec516ac88be0cf2c (patch) | |
tree | ba9613519281aaffa48088f4bb4e0d1125e4c88e /include/git2/odb_backend.h | |
parent | 4a51e9981469c883225f774715d987bce2d41ee2 (diff) | |
download | libgit2-ecd6fdf1f70b785f24e2d17bec516ac88be0cf2c.tar.gz |
Added a read_unique_short_oid method to backends, to make it possible to find objects from sha1 prefixes in the future. Default implementations throw GIT_ENOTIMPLEMENTED for strict prefixes (i.e. length < GIT_OID_HEXSZ).
Diffstat (limited to 'include/git2/odb_backend.h')
-rw-r--r-- | include/git2/odb_backend.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/git2/odb_backend.h b/include/git2/odb_backend.h index ba41f726c..44049b6f1 100644 --- a/include/git2/odb_backend.h +++ b/include/git2/odb_backend.h @@ -49,6 +49,19 @@ struct git_odb_backend { struct git_odb_backend *, const git_oid *); + /* To find a unique object given a prefix + * of its oid. + * The oid given must be so that the + * remaining (GIT_OID_HEXSZ - len)*4 bits + * are 0s. + */ + int (* read_unique_short_oid)( + git_oid *, + void **, size_t *, git_otype *, + struct git_odb_backend *, + const git_oid *, + unsigned int len); + int (* read_header)( size_t *, git_otype *, struct git_odb_backend *, |