Skip to content

Commit

Permalink
fix: Don't load settings if not a valid git repository
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
RussKie committed Jun 24, 2018
1 parent 04b2ac7 commit 82aace5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion GitUI/CommandsDialogs/FormClone.cs
Expand Up @@ -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())
Expand Down

0 comments on commit 82aace5

Please sign in to comment.