Commit 58d757b1 by Jason Haslam Committed by KOLANICH

patch: add owner accessor

parent 03ea04bf
......@@ -29,6 +29,14 @@ GIT_BEGIN_DECL
typedef struct git_patch git_patch;
/**
* Get the repository associated with this patch. May be NULL.
*
* @param patch the patch
* @return a pointer to the repository
*/
GIT_EXTERN(git_repository *) git_patch_owner(const git_patch *patch);
/**
* Return a patch for an entry in the diff list.
*
* The `git_patch` is a newly created object contains the text diffs
......
......@@ -204,6 +204,11 @@ int git_patch_get_line_in_hunk(
return 0;
}
git_repository *git_patch_owner(const git_patch *patch)
{
return patch->repo;
}
int git_patch_from_diff(git_patch **out, git_diff *diff, size_t idx)
{
GIT_ASSERT_ARG(out);
......
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