Merge pull request #1289 from jwiegley/development

Added git_treebuilder_entrycount
This commit is contained in:
Vicent Martí 2013-01-28 14:54:19 -08:00
commit 764b9e7146
2 changed files with 14 additions and 0 deletions

View File

@ -258,6 +258,14 @@ GIT_EXTERN(int) git_treebuilder_create(
*/ */
GIT_EXTERN(void) git_treebuilder_clear(git_treebuilder *bld); GIT_EXTERN(void) git_treebuilder_clear(git_treebuilder *bld);
/**
* Get the number of entries listed in a treebuilder
*
* @param tree a previously loaded treebuilder.
* @return the number of entries in the treebuilder
*/
GIT_EXTERN(unsigned int) git_treebuilder_entrycount(git_treebuilder *bld);
/** /**
* Free a tree builder * Free a tree builder
* *

View File

@ -340,6 +340,12 @@ size_t git_tree_entrycount(const git_tree *tree)
return tree->entries.length; return tree->entries.length;
} }
unsigned int git_treebuilder_entrycount(git_treebuilder *bld)
{
assert(bld);
return bld->entries.length;
}
static int tree_error(const char *str, const char *path) static int tree_error(const char *str, const char *path)
{ {
if (path) if (path)