private void OkClick(object sender, EventArgs e)
{
try
{
var dirTo = _NO_TRANSLATE_To.Text;
if (!dirTo.EndsWith(Settings.PathSeperator.ToString()) && !dirTo.EndsWith(Settings.PathSeperatorWrong.ToString()))
dirTo += Settings.PathSeperator.ToString();
dirTo += _NO_TRANSLATE_NewDirectory.Text;
Repositories.RepositoryHistory.AddMostRecentRepository(_NO_TRANSLATE_From.Text);
Repositories.RepositoryHistory.AddMostRecentRepository(dirTo);
var fromProcess =
new FormProcess(Settings.GitCommand,
GitCommands.GitCommands.CloneCmd(_NO_TRANSLATE_From.Text, dirTo,
CentralRepository.Checked, null));
fromProcess.ShowDialog();
if (fromProcess.ErrorOccured() || GitCommands.GitCommands.InTheMiddleOfPatch())
return;
if (ShowInTaskbar == false && AskIfNewRepositoryShouldBeOpened(dirTo))
{
Settings.WorkingDir = dirTo;
if (File.Exists(Settings.WorkingDir + ".gitmodules") &&
AskIfSubmodulesShouldBeInitialized())
InitSubmodules();
}
Close();
}
catch (Exception ex)
{
Trace.WriteLine(ex.Message);
}
}