diff options
| author | Etienne Samson <samson.etienne@gmail.com> | 2018-08-25 01:47:39 +0000 |
|---|---|---|
| committer | Etienne Samson <samson.etienne@gmail.com> | 2018-10-19 20:39:17 +0200 |
| commit | 6e9fb040d9ea521f855257736369f42463cc45e8 (patch) | |
| tree | 1e794e315f0242ae8560e0093cbf6ab677baf80f /include | |
| parent | 5c0c8fdd39112eb28402313105b3cc047b2400c0 (diff) | |
| download | libgit2-6e9fb040d9ea521f855257736369f42463cc45e8.tar.gz | |
merge: make analysis possible against a non-HEAD reference
This moves the current merge analysis code into a more generic version
that can work against any reference.
Also change the tests to check returned analysis values exactly.
Diffstat (limited to 'include')
| -rw-r--r-- | include/git2/merge.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/git2/merge.h b/include/git2/merge.h index 47bf32daa..862721370 100644 --- a/include/git2/merge.h +++ b/include/git2/merge.h @@ -389,6 +389,25 @@ GIT_EXTERN(int) git_merge_analysis( size_t their_heads_len); /** + * Analyzes the given branch(es) and determines the opportunities for + * merging them into a reference. + * + * @param analysis_out analysis enumeration that the result is written into + * @param repo the repository to merge + * @param our_ref the reference to perform the analysis from + * @param their_heads the heads to merge into + * @param their_heads_len the number of heads to merge + * @return 0 on success or error code + */ +GIT_EXTERN(int) git_merge_analysis_for_ref( + git_merge_analysis_t *analysis_out, + git_merge_preference_t *preference_out, + git_repository *repo, + git_reference *our_ref, + const git_annotated_commit **their_heads, + size_t their_heads_len); + +/** * Find a merge base between two commits * * @param out the OID of a merge base between 'one' and 'two' |
