private void InitMergetool()
{
GitCommands.GitCommands gitCommands = new GitCommands.GitCommands();
mergetool = GitCommands.GitCommands.GetSetting("merge.tool");
if (string.IsNullOrEmpty(mergetool))
mergetool = gitCommands.GetGlobalSetting("merge.tool");
if (string.IsNullOrEmpty(mergetool))
{
MessageBox.Show(noMergeTool.Text);
return;
}
Cursor.Current = Cursors.WaitCursor;
mergetoolCmd = GitCommands.GitCommands.GetSetting("mergetool." + mergetool + ".cmd");
if (string.IsNullOrEmpty(mergetoolCmd))
mergetoolCmd = gitCommands.GetGlobalSetting("mergetool." + mergetool + ".cmd");
mergetoolPath = GitCommands.GitCommands.GetSetting("mergetool." + mergetool + ".path");
if (string.IsNullOrEmpty(mergetoolPath))
mergetoolPath = gitCommands.GetGlobalSetting("mergetool." + mergetool + ".path");
if (string.IsNullOrEmpty(mergetool) || mergetool == "kdiff3")
mergetoolCmd = mergetoolPath + " \"$BASE\" \"$LOCAL\" \"$REMOTE\" -o \"$MERGED\"";
mergetoolPath = mergetoolCmd.Substring(0, mergetoolCmd.IndexOf(".exe") + 5).Trim(new char[] { '\"', ' ' });
mergetoolCmd = mergetoolCmd.Substring(mergetoolCmd.IndexOf(".exe") + 5);
Cursor.Current = Cursors.Default;
}