mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-22 06:26:26 +00:00
commit: introduce git_repository_commit_parents
Emulating `git commit` is clunky - identifying your commit's parents is part of the problem. Provide a helper to give you the parents given the current repository state.
This commit is contained in:
@@ -541,6 +541,24 @@ typedef int (*git_commit_create_cb)(
|
||||
const git_commit *parents[],
|
||||
void *payload);
|
||||
|
||||
/** An array of commits returned from the library */
|
||||
typedef struct git_commitarray {
|
||||
git_commit **commits;
|
||||
size_t count;
|
||||
} git_commitarray;
|
||||
|
||||
/**
|
||||
* Free the commits contained in a commit array. This method should
|
||||
* be called on `git_commitarray` objects that were provided by the
|
||||
* library. Not doing so will result in a memory leak.
|
||||
*
|
||||
* This does not free the `git_commitarray` itself, since the library
|
||||
* will never allocate that object directly itself.
|
||||
*
|
||||
* @param array The git_commitarray that contains commits to free
|
||||
*/
|
||||
GIT_EXTERN(void) git_commitarray_dispose(git_commitarray *array);
|
||||
|
||||
/** @} */
|
||||
GIT_END_DECL
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user