Add close wappers for commit, tree, tag and blob

In the same spirit that git_repository_lookup is no longer available,
add wrappers so the users don't have to cast when closing their
objects.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
This commit is contained in:
Carlos Martín Nieto
2011-03-22 16:15:50 +01:00
parent 7c80c19e1d
commit b0b8313583
4 changed files with 71 additions and 0 deletions

View File

@@ -53,6 +53,23 @@ GIT_INLINE(int) git_commit_lookup(git_commit **commit, git_repository *repo, con
return git_object_lookup((git_object **)commit, repo, id, GIT_OBJ_COMMIT);
}
/**
* Close an open commit
*
* This is a wrapper around git_object_close()
*
* IMPORTANT:
* It *is* necessary to call this method when you stop
* using a commit. Failure to do so will cause a memory leak.
*
* @param commit the commit to close
*/
GIT_INLINE(void) git_commit_close(git_commit *commit)
{
return git_object_close((git_object *) commit);
}
/**
* Get the id of a commit.
*