1
1
namespace GitVersion
2
2
{
3
+ using GitVersion . Configuration . Init . Wizard ;
4
+ using GitVersion . Helpers ;
3
5
using System . Collections . Generic ;
4
6
using System . ComponentModel ;
5
7
using System . IO ;
6
8
using System . Linq ;
7
9
using System . Text ;
8
- using GitVersion . Configuration . Init . Wizard ;
9
- using GitVersion . Helpers ;
10
10
11
11
public class ConfigurationProvider
12
12
{
@@ -103,10 +103,27 @@ static void MigrateBranches(Config config)
103
103
// Map of current names and previous names
104
104
var dict = new Dictionary < string , string [ ] >
105
105
{
106
- { "hotfix(es)?[/-]" , new [ ] { "hotfix[/-]" } } ,
107
- { "features?[/-]" , new [ ] { "feature[/-]" , "feature(s)?[/-]" } } ,
108
- { "releases?[/-]" , new [ ] { "release[/-]" } } ,
109
- { "dev(elop)?(ment)?$" , new [ ] { "develop" } }
106
+ { "hotfix(es)?[/-]" , new [ ]
107
+ {
108
+ "hotfix[/-]"
109
+ }
110
+ } ,
111
+ { "features?[/-]" , new [ ]
112
+ {
113
+ "feature[/-]" ,
114
+ "feature(s)?[/-]"
115
+ }
116
+ } ,
117
+ { "releases?[/-]" , new [ ]
118
+ {
119
+ "release[/-]"
120
+ }
121
+ } ,
122
+ { "dev(elop)?(ment)?$" , new [ ]
123
+ {
124
+ "develop"
125
+ }
126
+ }
110
127
} ;
111
128
112
129
foreach ( var mapping in dict )
@@ -186,12 +203,12 @@ public static void Verify(GitPreparer gitPreparer, IFileSystem fileSystem)
186
203
var workingDirectory = gitPreparer . WorkingDirectory ;
187
204
var projectRootDirectory = gitPreparer . GetProjectRootDirectory ( ) ;
188
205
189
- Verify ( workingDirectory , projectRootDirectory , fileSystem ) ;
206
+ Verify ( workingDirectory , projectRootDirectory , fileSystem ) ;
190
207
}
191
208
192
209
public static void Verify ( string workingDirectory , string projectRootDirectory , IFileSystem fileSystem )
193
210
{
194
- if ( fileSystem . PathsEqual ( workingDirectory , projectRootDirectory ) )
211
+ if ( fileSystem . PathsEqual ( workingDirectory , projectRootDirectory ) )
195
212
{
196
213
WarnAboutObsoleteConfigFile ( workingDirectory , fileSystem ) ;
197
214
return ;
@@ -200,6 +217,11 @@ public static void Verify(string workingDirectory, string projectRootDirectory,
200
217
WarnAboutObsoleteConfigFile ( workingDirectory , fileSystem ) ;
201
218
WarnAboutObsoleteConfigFile ( projectRootDirectory , fileSystem ) ;
202
219
220
+ WarnAboutAmbigousConfigFileSelection ( workingDirectory , projectRootDirectory , fileSystem ) ;
221
+ }
222
+
223
+ private static void WarnAboutAmbigousConfigFileSelection ( string workingDirectory , string projectRootDirectory , IFileSystem fileSystem )
224
+ {
203
225
var workingConfigFile = GetConfigFilePath ( workingDirectory , fileSystem ) ;
204
226
var projectRootConfigFile = GetConfigFilePath ( projectRootDirectory , fileSystem ) ;
205
227
@@ -280,4 +302,4 @@ public static void Init(string workingDirectory, IFileSystem fileSystem, IConsol
280
302
}
281
303
}
282
304
}
283
- }
305
+ }
0 commit comments