Fixes to diff callback and additional merge methods
The first patch fixes hunk=null which appears when calling diff.print like this.
diff.print(Ggit.DiffFormatType.PATCH, ( delta, hunk, line) => {
GLib.debug("%d: %s, %s", line.get_new_lineno(), line.get_origin().to_string(), line.get_text());
return 0;
});
Second patch adds support for GitRepository.merge_base() - which finds the common ancestor between two branchs.
Third patch adds support for GitRepository.merge() - which appears merges to commits(usually branches) into the working branch.
var mo = new Ggit.MergeOptions();
var co = new Ggit.CheckoutOptions();
var the_ref = repository.lookup_reference_dwim("refs/heads/master");
var ac = new Ggit.AnnotatedCommit.from_ref(this.repo, the_ref);
var commits = new Ggit.AnnotatedCommit[] { ac };
repository.merge(commits, mo, co);
Edited by Alan