diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2013-04-30 14:56:41 -0500 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2013-04-30 16:01:11 -0500 |
commit | 0462fba538b380551cbd5d8c05281352ba7a7471 (patch) | |
tree | ea9c353de8f20b0ed68fb0cf3c747677d876b9fe /include/git2/index.h | |
parent | bec65a5e994bc4701216c9ca2c7dae83770b3edc (diff) | |
download | libgit2-0462fba538b380551cbd5d8c05281352ba7a7471.tar.gz |
renames!
Diffstat (limited to 'include/git2/index.h')
-rw-r--r-- | include/git2/index.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/include/git2/index.h b/include/git2/index.h index fcfe4be3d..01e3d2c29 100644 --- a/include/git2/index.h +++ b/include/git2/index.h @@ -84,6 +84,12 @@ typedef struct git_index_entry { char *path; } git_index_entry; +typedef struct git_index_name_entry { + char *ancestor; + char *ours; + char *theirs; +} git_index_name_entry; + /** Representation of a resolve undo entry in the index. */ typedef struct git_index_reuc_entry { unsigned int mode[3]; @@ -478,6 +484,53 @@ GIT_EXTERN(int) git_index_has_conflicts(const git_index *index); /**@}*/ +/** @name Conflict Name entry functions + * + * These functions work on rename conflict entries. + */ +/**@{*/ + +/** + * Get the count of filename conflict entries currently in the index. + * + * @param index an existing index object + * @return integer of count of current filename conflict entries + */ +GIT_EXTERN(unsigned int) git_index_name_entrycount(git_index *index); + +/** + * Get a filename conflict entry from the index. + * + * The returned entry is read-only and should not be modified + * or freed by the caller. + * + * @param index an existing index object + * @param n the position of the entry + * @return a pointer to the filename conflict entry; NULL if out of bounds + */ +GIT_EXTERN(const git_index_name_entry *) git_index_name_get_byindex( + git_index *index, size_t n); + +/** + * Record the filenames involved in a rename conflict. + * + * @param index an existing index object + * @param ancestor the path of the file as it existed in the ancestor + * @param ours the path of the file as it existed in our tree + * @param theirs the path of the file as it existed in their tree + */ +GIT_EXTERN(int) git_index_name_add(git_index *index, + const char *ancestor, const char *ours, const char *theirs); + +/** + * Remove all filename conflict entries. + * + * @param index an existing index object + * @return 0 or an error code + */ +GIT_EXTERN(void) git_index_name_clear(git_index *index); +/**@}*/ + /** @name Resolve Undo (REUC) index entry manipulation. * * These functions work on the Resolve Undo index extension and contains |