summaryrefslogtreecommitdiff
path: root/include/git2/index.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-06-03 21:38:55 +0200
committerVicent Marti <tanoku@gmail.com>2011-06-03 21:38:55 +0200
commit3a42e0a3705d5d47ed32579721a62edf4ff297b1 (patch)
tree3597fede71b01373d48e3c67464c5a217e0fe3e0 /include/git2/index.h
parent0291b5b76bd8dcbac1118533c7a79a619ade766c (diff)
downloadlibgit2-3a42e0a3705d5d47ed32579721a62edf4ff297b1.tar.gz
index: Add `git_index_entry_stage` method
As suggested by Romain-Geissler
Diffstat (limited to 'include/git2/index.h')
-rw-r--r--include/git2/index.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/git2/index.h b/include/git2/index.h
index 45900d08d..fa1cadeab 100644
--- a/include/git2/index.h
+++ b/include/git2/index.h
@@ -287,6 +287,18 @@ GIT_EXTERN(unsigned int) git_index_entrycount_unmerged(git_index *index);
*/
GIT_EXTERN(const git_index_entry_unmerged *) git_index_get_unmerged(git_index *index, const char *path);
+/**
+ * Return the stage number from a git index entry
+ *
+ * This entry is calculated from the entrie's flag
+ * attribute like this:
+ *
+ * (entry->flags & GIT_IDXENTRY_STAGEMASK) >> GIT_IDXENTRY_STAGESHIFT
+ *
+ * @param entry The entry
+ * @returns the stage number
+ */
+GIT_EXTERN(int) git_index_entry_stage(const git_index_entry *entry);
/** @} */
GIT_END_DECL