Commit 0be42199 by Scott Chacon Committed by Vicent Marti

accessor for index entry count

parent 69f0295c
......@@ -147,6 +147,14 @@ GIT_EXTERN(int) git_index_add(git_index *index, const git_index_entry *source_en
*/
GIT_EXTERN(git_index_entry *) git_index_get(git_index *index, int n);
/**
* Get the count of entries currently in the index
*
* @param index an existing index object
* @return integer of count of current entries
*/
GIT_EXTERN(unsigned int) git_index_entrycount(git_index *index);
/** @} */
GIT_END_DECL
......
......@@ -221,6 +221,12 @@ int git_index_write(git_index *index)
return 0;
}
unsigned int git_index_entrycount(git_index *index)
{
assert(index);
return index->entry_count;
}
git_index_entry *git_index_get(git_index *index, int n)
{
assert(index);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment