private void DiffTool_Click(object sender, EventArgs e)
{
GitCommands.GitCommands gitCommands = new GitCommands.GitCommands();
if (string.IsNullOrEmpty(gitCommands.GetGlobalSetting("merge.tool")))
{
if (MessageBox.Show("There is no mergetool configured. Do you want to configure kdiff3 as your mergetool?" + Environment.NewLine + "Select no if you want to configure a different mergetool yourself.", "Mergetool", MessageBoxButtons.YesNo) == DialogResult.Yes)
{
SolveKDiff();
GlobalMergeTool.Text = "kdiff3";
}
else
{
tabControl1.SelectTab("GlobalSettingsPage");
return;
}
}
if (gitCommands.GetGlobalSetting("merge.tool").Equals("kdiff3", StringComparison.CurrentCultureIgnoreCase))
{
SolveKDiffPath(gitCommands);
}
else
if (gitCommands.GetGlobalSetting("merge.tool").Equals("p4merge", StringComparison.CurrentCultureIgnoreCase) ||
gitCommands.GetGlobalSetting("merge.tool").Equals("TortoiseMerge", StringComparison.CurrentCultureIgnoreCase))
{
AutoConfigMergeToolcmd();
gitCommands.SetGlobalSetting("mergetool." + gitCommands.GetGlobalSetting("merge.tool") + ".cmd", MergeToolCmd.Text);
}
if (gitCommands.GetGlobalSetting("merge.tool").Equals("kdiff3", StringComparison.CurrentCultureIgnoreCase) && string.IsNullOrEmpty(gitCommands.GetGlobalSetting("mergetool.kdiff3.path")))
{
MessageBox.Show("Path to kdiff3 could not be found automatically." + Environment.NewLine + "Please make sure KDiff3 is installed or set path manually.");
tabControl1.SelectTab("GlobalSettingsPage");
return;
}
Rescan_Click(null, null);
}