Apply a git_diff to the given repository, making changes directly in the working directory, the index, or both.
git_diff
the repository to apply to
the diff to apply
the location to apply (workdir, index or both)
the options for the apply (or null for defaults)
0 or an error code