SoftwareArchitec
SoftwareArchitec

Reputation: 53

libgit2sharp equivalent of "git mergetool"

I want to use the equivalent of "git mergetool" within libgit2sharp. Is there a sample to do this? Or do I have to dive deep and try to implement this in libgit2sharp?

The call "git mergetool" checks if merge is required and calls the custom mergetool with a copy of the server. A proper way to call the mergetool would be usefull. I know I can read the config and search the mergetool and its "cmd" command.

Greetings Thomas

Upvotes: 3

Views: 185

Answers (1)

yorah
yorah

Reputation: 2673

LibGit2Sharp is used to programmatically interact with a git repository. It won't launch a mergetool directly.

However, you can use LibGit2Sharp to retrieve the configuration values from a given repository. For instance, by using:

var mergeTool = repo.Config.Get<string>("merge.tool").Value;
var path = repo.Config.Get<string>("mergetool." + mergeTool + ".path").Value;

You can retrieve the path of the configured merge tool.

Upvotes: 1

Related Questions