在libgit2中,当用户git_合并失败时,如何输出通知回调?

在libgit2中,当用户git_合并失败时,如何输出通知回调?,libgit2,Libgit2,我正试图从libgit2的回购中获利 我的步骤如下: 我使用git_remote_fetch关闭远程源数据并返回OK 在我使用git_合并API之后。 问题是两个用户修改同一文件的同一区域,libgit2将报告内容冲突。此状态正常 接下来我只删除本地文件“a.txt”,同时修改远程分支文件“b.txt”。并在my git_checkout_选项中设置notify_cb,并设置notify_标志以包括git_checkout_notify_CONFLICT|git_checkout_notify_

我正试图从libgit2的回购中获利

我的步骤如下:

我使用git_remote_fetch关闭远程源数据并返回OK

在我使用git_合并API之后。 问题是两个用户修改同一文件的同一区域,libgit2将报告内容冲突。此状态正常

接下来我只删除本地文件“a.txt”,同时修改远程分支文件“b.txt”。并在my git_checkout_选项中设置notify_cb,并设置notify_标志以包括git_checkout_notify_CONFLICT|git_checkout_notify_ALL。结果git_merge只返回错误代码'-13',没有输出冲突文件名。合并失败时,如何从notify回调获取冲突文件名

git_merge_options checkout_opt = GIT_CHECKOUT_OPTINS_INIT;
git_checkout_options checkout_opt = GIT_CHECKOUT_OPTIONS_INT;
checkout_opt.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_ALLOW_CONFLICTS;
checkout_opt.notify_flags = GIT_CHECKOUT_NOTIFY_ALL | GIT_CHECKOUT_NOTIFY_CONFLICT;
checkout_opt.notify_cb = git_checkout_notify_cb // git_checkout_notify_cb is myself write callback.

int error = git_merge(repo, &their_head[0],1, &merge_opt, &checkout);
if(error<0)
{
   //Just output error code -13. no call notify callback.
}
git\u merge\u options checkout\u opt=git\u checkout\u OPTINS\u INIT;
git\u checkout\u options checkout\u opt=git\u checkout\u options\u INT;
checkout_opt.checkout_strategy=GIT_checkout_SAFE | GIT_checkout_ALLOW_冲突;
checkout_opt.notify_flags=GIT_checkout_notify_ALL | GIT_checkout_notify_冲突;
checkout\u opt.notify\u cb=git\u checkout\u notify\u cb//git\u checkout\u notify\u cb是我自己写的回调。
int error=git\u merge(回购及其头[0]、1、&merge\u opt、&checkout);
如果(错误)