diff options
author | Russell Belfer <rb@github.com> | 2014-03-04 15:34:23 -0800 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2014-03-04 15:34:23 -0800 |
commit | f5753999e4cac020c2dd3a4669fe9ba14df93cb5 (patch) | |
tree | 13e38551546181a59c0dae367192008c555e1fee /include/git2/odb.h | |
parent | 0a62caf4e4927cbf74f40d8a2cb44b84267a30da (diff) | |
download | libgit2-f5753999e4cac020c2dd3a4669fe9ba14df93cb5.tar.gz |
Add exists_prefix to ODB backend and ODB API
Diffstat (limited to 'include/git2/odb.h')
-rw-r--r-- | include/git2/odb.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/git2/odb.h b/include/git2/odb.h index 82df4d300..c71e30648 100644 --- a/include/git2/odb.h +++ b/include/git2/odb.h @@ -159,6 +159,19 @@ GIT_EXTERN(int) git_odb_read_header(size_t *len_out, git_otype *type_out, git_od GIT_EXTERN(int) git_odb_exists(git_odb *db, const git_oid *id); /** + * Determine if objects can be found in the object database from a short OID. + * + * @param out The full OID of the found object if just one is found. + * @param db The database to be searched for the given object. + * @param short_id A prefix of the id of the object to read. + * @param len The length of the prefix. + * @return 0 if found, GIT_ENOTFOUND if not found, GIT_EAMBIGUOUS if multiple + * matches were found, other value < 0 if there was a read error. + */ +GIT_EXTERN(int) git_odb_exists_prefix( + git_oid *out, git_odb *db, const git_oid *short_id, size_t len); + +/** * Refresh the object database to load newly added files. * * If the object databases have changed on disk while the library |