summaryrefslogtreecommitdiff
path: root/include/git2/index.h
diff options
context:
space:
mode:
authorRomain Geissler <romain.geissler@gmail.com>2011-06-05 21:19:03 +0200
committerRomain Geissler <romain.geissler@gmail.com>2011-06-05 21:19:03 +0200
commitf11e079733e38c83bbc1b00c75c96c031825ec25 (patch)
treecb49611341ea3d77fdcb7520927ff027e4302f15 /include/git2/index.h
parente5c8009731f3ccaf67b5b62546d890301ecb1f25 (diff)
downloadlibgit2-f11e079733e38c83bbc1b00c75c96c031825ec25.tar.gz
Index: API uniformisation: Use unsigned int for all index number.
Feature Added: Search an unmerged entry by path (git_index_get_unmerged renamed to git_index_get_unmerged_bypath) or by index (git_index_get_unmerged_byindex).
Diffstat (limited to 'include/git2/index.h')
-rw-r--r--include/git2/index.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/include/git2/index.h b/include/git2/index.h
index fa1cadeab..83a18e160 100644
--- a/include/git2/index.h
+++ b/include/git2/index.h
@@ -257,7 +257,7 @@ GIT_EXTERN(int) git_index_remove(git_index *index, int position);
* @param n the position of the entry
* @return a pointer to the entry; NULL if out of bounds
*/
-GIT_EXTERN(git_index_entry *) git_index_get(git_index *index, int n);
+GIT_EXTERN(git_index_entry *) git_index_get(git_index *index, unsigned int n);
/**
* Get the count of entries currently in the index
@@ -285,7 +285,19 @@ GIT_EXTERN(unsigned int) git_index_entrycount_unmerged(git_index *index);
* @param path path to search
* @return the unmerged entry; NULL if not found
*/
-GIT_EXTERN(const git_index_entry_unmerged *) git_index_get_unmerged(git_index *index, const char *path);
+GIT_EXTERN(const git_index_entry_unmerged *) git_index_get_unmerged_bypath(git_index *index, const char *path);
+
+/**
+ * Get an unmerged entry from the index.
+ *
+ * The returned entry is read-only and should not be modified
+ * of freed by the caller.
+ *
+ * @param index an existing index object
+ * @param n the position of the entry
+ * @return a pointer to the unmerged entry; NULL if out of bounds
+ */
+GIT_EXTERN(const git_index_entry_unmerged *) git_index_get_unmerged_byindex(git_index *index, unsigned int n);
/**
* Return the stage number from a git index entry