Skip to content
This repository was archived by the owner on Oct 4, 2021. It is now read-only.

Commit 77795d8

Browse files
committed
Changed the behavior of the gitignore checkbox enabled status
1 parent 854a271 commit 77795d8

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects/FinalProjectConfigurationPage.cs

+13-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
// THE SOFTWARE.
2626

2727
using System;
28+
using System.IO;
29+
using MonoDevelop.Core;
2830
using MonoDevelop.Core.StringParsing;
2931
using MonoDevelop.Ide.Templates;
3032
using ProjectCreateParameters = MonoDevelop.Projects.ProjectCreateParameters;
@@ -180,7 +182,7 @@ public bool IsCreateProjectDirectoryInsideSolutionDirectoryEnabled {
180182
}
181183

182184
public bool IsGitIgnoreEnabled {
183-
get { return config.UseGit && gitIgnoreEnabled; }
185+
get { return config.UseGit && gitIgnoreEnabled && EnableCreateGitIgnore(); }
184186
}
185187

186188
public bool IsUseGitEnabled { get; set; }
@@ -264,6 +266,16 @@ public void UpdateFromParameters ()
264266
return Parameters.GetBoolValue (name);
265267
}
266268
return null;
269+
}
270+
271+
bool EnableCreateGitIgnore ()
272+
{
273+
FilePath solutionPath = config.SolutionLocation;
274+
if (Location == solutionPath) {
275+
FilePath gitIgnoreFilePath = solutionPath.Combine (".gitignore");
276+
return !File.Exists (gitIgnoreFilePath);
277+
}
278+
return true;
267279
}
268280
}
269281
}

0 commit comments

Comments
 (0)