From 82aace505fda35c9025e6762a94ac31e0e1a96ca Mon Sep 17 00:00:00 2001 From: RussKie Date: Mon, 25 Jun 2018 08:02:38 +1000 Subject: [PATCH] fix: Don't load settings if not a valid git repository If attempt to clone into a folder that is not a valid git folder, but which contains 'config' file with an invalid (from GE's POV) content, GE would attempt to load and parse the 'config' file and crash the app. This is a minimal fix to top this from happening by checking the location for being a valid git repostitory. --- GitUI/CommandsDialogs/FormClone.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GitUI/CommandsDialogs/FormClone.cs b/GitUI/CommandsDialogs/FormClone.cs index 0304cbf551b..72c3be67af6 100644 --- a/GitUI/CommandsDialogs/FormClone.cs +++ b/GitUI/CommandsDialogs/FormClone.cs @@ -88,7 +88,7 @@ protected override void OnRuntimeLoad(EventArgs e) } //if the From field is empty, then fill it with the current repository remote URL in hope //that the cloned repository is hosted on the same server - if (_NO_TRANSLATE_From.Text.IsNullOrWhiteSpace()) + if (_NO_TRANSLATE_From.Text.IsNullOrWhiteSpace() && Module.IsValidGitWorkingDir()) { var currentBranchRemote = Module.GetSetting(string.Format(SettingKeyString.BranchRemote, Module.GetSelectedBranch())); if (currentBranchRemote.IsNullOrEmpty())