diff options
| author | Edward Thomson <ethomson@github.com> | 2016-08-17 09:24:44 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-17 09:24:44 -0500 |
| commit | c1b370e9313a13df350974e2237997cc651a5d67 (patch) | |
| tree | 192fffba5ba3bb5982cb675955d647cbd170b54c /include/git2 | |
| parent | 635a922274046ee077235b9764d0360e33d735ab (diff) | |
| parent | 5625d86b994fd81f1b0d887890e8168d7b5f46cc (diff) | |
| download | libgit2-c1b370e9313a13df350974e2237997cc651a5d67.tar.gz | |
Merge pull request #3837 from novalis/dturner/indexv4
Support index v4
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. * |
