diff options
author | David Turner <dturner@twopensource.com> | 2016-05-17 15:40:32 -0400 |
---|---|---|
committer | David Turner <dturner@twosigma.com> | 2016-08-10 14:19:30 -0400 |
commit | 5625d86b994fd81f1b0d887890e8168d7b5f46cc (patch) | |
tree | 9c229286979e8fc8f98657a821faf591072ff636 /include/git2 | |
parent | aeb5ee5ab50a062aac02ca084b02582430669808 (diff) | |
download | libgit2-5625d86b994fd81f1b0d887890e8168d7b5f46cc.tar.gz |
index: support index v4
Support reading and writing index v4. Index v4 uses a very simple
compression scheme for pathnames, but is otherwise similar to index v3.
Signed-off-by: David Turner <dturner@twitter.com>
Diffstat (limited to 'include/git2')
-rw-r--r-- | include/git2/index.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/git2/index.h b/include/git2/index.h index 466765be3..e58b3287e 100644 --- a/include/git2/index.h +++ b/include/git2/index.h @@ -252,6 +252,31 @@ GIT_EXTERN(int) git_index_caps(const git_index *index); GIT_EXTERN(int) git_index_set_caps(git_index *index, int caps); /** + * Get index on-disk version. + * + * Valid return values are 2, 3, or 4. If 3 is returned, an index + * with version 2 may be written instead, if the extension data in + * version 3 is not necessary. + * + * @param index An existing index object + * @return the index version + */ +GIT_EXTERN(unsigned int) git_index_version(git_index *index); + +/** + * Set index on-disk version. + * + * Valid values are 2, 3, or 4. If 2 is given, git_index_write may + * write an index with version 3 instead, if necessary to accurately + * represent the index. + * + * @param index An existing index object + * @param version The new version number + * @return 0 on success, -1 on failure + */ +GIT_EXTERN(int) git_index_set_version(git_index *index, unsigned int version); + +/** * Update the contents of an existing index object in memory by reading * from the hard disk. * |