使用 libgit2sharp 拉取时显示冲突
Show conflicts when pulling using libgit2sharp
我正在使用 libgit2sharp 从使用默认 FetchOptions
、MergeOptions
和 PullOptions
的远程仓库中提取 (Commands.Pull
)。我的工作目录有一个未提交的更改会导致冲突,正如预期的那样,我收到 CheckOutConflictException
消息“1 冲突阻止签出”。
我想不通的是如何以编程方式找出导致冲突的文件。 repo.Index.Conflicts
不包含任何冲突,我在 wiki, and I can't find any tests for this case in the codebase.
中没有找到任何关于这种情况的文档
任何人都可以告诉我我缺少什么吗?
您想要添加一个 CheckoutOptions.OnCheckoutNotify
回调,它会在每次结帐遇到具有特定操作的路径时通知您。
在这种情况下,您想查找冲突,因此设置您的 CheckoutOptions.CheckoutNotifyFlags
to listen for CheckoutNotifyFlags.Conflict
。
对于每个存在检出冲突并给出路径的文件,您都会被回调。
我正在使用 libgit2sharp 从使用默认 FetchOptions
、MergeOptions
和 PullOptions
的远程仓库中提取 (Commands.Pull
)。我的工作目录有一个未提交的更改会导致冲突,正如预期的那样,我收到 CheckOutConflictException
消息“1 冲突阻止签出”。
我想不通的是如何以编程方式找出导致冲突的文件。 repo.Index.Conflicts
不包含任何冲突,我在 wiki, and I can't find any tests for this case in the codebase.
任何人都可以告诉我我缺少什么吗?
您想要添加一个 CheckoutOptions.OnCheckoutNotify
回调,它会在每次结帐遇到具有特定操作的路径时通知您。
在这种情况下,您想查找冲突,因此设置您的 CheckoutOptions.CheckoutNotifyFlags
to listen for CheckoutNotifyFlags.Conflict
。
对于每个存在检出冲突并给出路径的文件,您都会被回调。