This repository was archived by the owner on Oct 4, 2021. It is now read-only.
File tree 1 file changed +13
-1
lines changed
main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Projects
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change 25
25
// THE SOFTWARE.
26
26
27
27
using System ;
28
+ using System . IO ;
29
+ using MonoDevelop . Core ;
28
30
using MonoDevelop . Core . StringParsing ;
29
31
using MonoDevelop . Ide . Templates ;
30
32
using ProjectCreateParameters = MonoDevelop . Projects . ProjectCreateParameters ;
@@ -180,7 +182,7 @@ public bool IsCreateProjectDirectoryInsideSolutionDirectoryEnabled {
180
182
}
181
183
182
184
public bool IsGitIgnoreEnabled {
183
- get { return config . UseGit && gitIgnoreEnabled ; }
185
+ get { return config . UseGit && gitIgnoreEnabled && EnableCreateGitIgnore ( ) ; }
184
186
}
185
187
186
188
public bool IsUseGitEnabled { get ; set ; }
@@ -264,6 +266,16 @@ public void UpdateFromParameters ()
264
266
return Parameters . GetBoolValue ( name ) ;
265
267
}
266
268
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 ;
267
279
}
268
280
}
269
281
}
You can’t perform that action at this time.
0 commit comments