summaryrefslogtreecommitdiff
path: root/include/git2/index.h
diff options
context:
space:
mode:
authorJakob Pfender <jpfender@elegosoft.com>2011-04-21 10:54:54 +0200
committerJakob Pfender <jpfender@elegosoft.com>2011-04-21 10:54:54 +0200
commit4c0b6a6dac97f82da927720adb2e0bc285e0c2f1 (patch)
tree1ef213ef4e88ff27b3f4d0bb12e5e809725fe621 /include/git2/index.h
parentfee4c4255004c1f142e39d6884a4804eb38e3183 (diff)
downloadlibgit2-4c0b6a6dac97f82da927720adb2e0bc285e0c2f1.tar.gz
index: Add API for unmerged entries
New external functions: - git_index_unmerged_entrycount: Counts the unmerged entries in the index - git_index_get_unmerged: Gets an unmerged entry from the index by name New internal functions: - read_unmerged: Wrapper for read_unmerged_internal - read_unmerged_internal: Reads unmerged entries from the index if the index has the INDEX_EXT_UNMERGED_SIG set - unmerged_srch: Search function for unmerged vector - unmerged_cmp: Compare function for unmerged vector New data structures: - git_index now contains a git_vector unmerged that stores unmerged entries - git_index_entry_unmerged: Representation of an unmerged file entry. It represents all three versions of the file at the same time, with one name, three modes and three OIDs
Diffstat (limited to 'include/git2/index.h')
-rw-r--r--include/git2/index.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/git2/index.h b/include/git2/index.h
index 8a84f507..09993a15 100644
--- a/include/git2/index.h
+++ b/include/git2/index.h
@@ -111,6 +111,12 @@ typedef struct git_index_entry {
char *path;
} git_index_entry;
+/** Representation of an unmerged file entry in the index. */
+typedef struct git_index_entry_unmerged {
+ unsigned int mode[3];
+ git_oid oid[3];
+ char *path;
+} git_index_entry_unmerged;
/**
* Create a new Git index object as a memory representation
@@ -233,6 +239,24 @@ GIT_EXTERN(git_index_entry *) git_index_get(git_index *index, int n);
*/
GIT_EXTERN(unsigned int) git_index_entrycount(git_index *index);
+/**
+ * Get the count of unmerged entries currently in the index
+ *
+ * @param index an existing index object
+ * @return integer of count of current unmerged entries
+ */
+GIT_EXTERN(unsigned int) git_index_unmerged_entrycount(git_index *index);
+
+/**
+ * Get an unmerged entry from the index.
+ *
+ * @param entry the pointer to the new unmerged entry
+ * @param index an existing index object
+ * @param path path to search
+ * @return 0 on success, otherwise an error code
+ */
+GIT_EXTERN(int) git_index_get_unmerged(git_index_entry_unmerged **entry, git_index *index, const char *path);
+
/** @} */
GIT_END_DECL