@@ -47,9 +47,9 @@ public void GitProcess_GetConfiguration_ReturnsConfiguration()
47
47
{
48
48
string gitPath = GetGitPath ( ) ;
49
49
var trace = new NullTrace ( ) ;
50
- var env = new TestEnvironment ( ) ;
50
+ var trace2 = new NullTrace2 ( ) ;
51
51
var processManager = new TestProcessManager ( ) ;
52
- var git = new GitProcess ( trace , processManager , gitPath ) ;
52
+ var git = new GitProcess ( trace , trace2 , processManager , gitPath ) ;
53
53
var config = git . GetConfiguration ( ) ;
54
54
Assert . NotNull ( config ) ;
55
55
}
@@ -71,9 +71,9 @@ public void GitConfiguration_Enumerate_CallbackReturnsTrue_InvokesCallbackForEac
71
71
72
72
string gitPath = GetGitPath ( ) ;
73
73
var trace = new NullTrace ( ) ;
74
- var env = new TestEnvironment ( ) ;
74
+ var trace2 = new NullTrace2 ( ) ;
75
75
var processManager = new TestProcessManager ( ) ;
76
- var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
76
+ var git = new GitProcess ( trace , trace2 , processManager , gitPath , repoPath ) ;
77
77
IGitConfiguration config = git . GetConfiguration ( ) ;
78
78
79
79
var actualVisitedEntries = new List < ( string name , string value ) > ( ) ;
@@ -110,9 +110,9 @@ public void GitConfiguration_Enumerate_CallbackReturnsFalse_InvokesCallbackForEa
110
110
111
111
string gitPath = GetGitPath ( ) ;
112
112
var trace = new NullTrace ( ) ;
113
- var env = new TestEnvironment ( ) ;
113
+ var trace2 = new NullTrace2 ( ) ;
114
114
var processManager = new TestProcessManager ( ) ;
115
- var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
115
+ var git = new GitProcess ( trace , trace2 , processManager , gitPath , repoPath ) ;
116
116
IGitConfiguration config = git . GetConfiguration ( ) ;
117
117
118
118
var actualVisitedEntries = new List < ( string name , string value ) > ( ) ;
@@ -138,13 +138,12 @@ public void GitConfiguration_TryGet_Name_Exists_ReturnsTrueOutString()
138
138
{
139
139
string repoPath = CreateRepository ( out string workDirPath ) ;
140
140
ExecGit ( repoPath , workDirPath , "config --local user.name john.doe" ) . AssertSuccess ( ) ;
141
-
142
141
string gitPath = GetGitPath ( ) ;
143
142
var trace = new NullTrace ( ) ;
144
- var env = new TestEnvironment ( ) ;
143
+ var trace2 = new NullTrace2 ( ) ;
145
144
var processManager = new TestProcessManager ( ) ;
146
145
147
- var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
146
+ var git = new GitProcess ( trace , trace2 , processManager , gitPath , repoPath ) ;
148
147
IGitConfiguration config = git . GetConfiguration ( ) ;
149
148
150
149
bool result = config . TryGet ( "user.name" , false , out string value ) ;
@@ -160,9 +159,10 @@ public void GitConfiguration_TryGet_Name_DoesNotExists_ReturnsFalse()
160
159
161
160
string gitPath = GetGitPath ( ) ;
162
161
var trace = new NullTrace ( ) ;
163
- var env = new TestEnvironment ( ) ;
162
+
163
+ var trace2 = new NullTrace2 ( ) ;
164
164
var processManager = new TestProcessManager ( ) ;
165
- var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
165
+ var git = new GitProcess ( trace , trace2 , processManager , gitPath , repoPath ) ;
166
166
IGitConfiguration config = git . GetConfiguration ( ) ;
167
167
168
168
string randomName = $ "{ Guid . NewGuid ( ) : N} .{ Guid . NewGuid ( ) : N} ";
@@ -180,9 +180,9 @@ public void GitConfiguration_TryGet_IsPath_True_ReturnsCanonicalPath()
180
180
string homeDirectory = Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) ;
181
181
string gitPath = GetGitPath ( ) ;
182
182
var trace = new NullTrace ( ) ;
183
- var env = new TestEnvironment ( ) ;
183
+ var trace2 = new NullTrace2 ( ) ;
184
184
var processManager = new TestProcessManager ( ) ;
185
- var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
185
+ var git = new GitProcess ( trace , trace2 , processManager , gitPath , repoPath ) ;
186
186
IGitConfiguration config = git . GetConfiguration ( ) ;
187
187
188
188
bool result = config . TryGet ( "example.path" , true , out string value ) ;
@@ -199,9 +199,9 @@ public void GitConfiguration_TryGet_IsPath_False_ReturnsRawConfig()
199
199
200
200
string gitPath = GetGitPath ( ) ;
201
201
var trace = new NullTrace ( ) ;
202
- var env = new TestEnvironment ( ) ;
202
+ var trace2 = new NullTrace2 ( ) ;
203
203
var processManager = new TestProcessManager ( ) ;
204
- var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
204
+ var git = new GitProcess ( trace , trace2 , processManager , gitPath , repoPath ) ;
205
205
IGitConfiguration config = git . GetConfiguration ( ) ;
206
206
207
207
bool result = config . TryGet ( "example.path" , false , out string value ) ;
@@ -218,9 +218,9 @@ public void GitConfiguration_TryGet_BoolType_ReturnsCanonicalBool()
218
218
219
219
string gitPath = GetGitPath ( ) ;
220
220
var trace = new NullTrace ( ) ;
221
- var env = new TestEnvironment ( ) ;
221
+ var trace2 = new NullTrace2 ( ) ;
222
222
var processManager = new TestProcessManager ( ) ;
223
- var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
223
+ var git = new GitProcess ( trace , trace2 , processManager , gitPath , repoPath ) ;
224
224
IGitConfiguration config = git . GetConfiguration ( ) ;
225
225
226
226
bool result = config . TryGet ( GitConfigurationLevel . Local , GitConfigurationType . Bool ,
@@ -238,9 +238,9 @@ public void GitConfiguration_TryGet_BoolWithoutType_ReturnsRawConfig()
238
238
239
239
string gitPath = GetGitPath ( ) ;
240
240
var trace = new NullTrace ( ) ;
241
- var env = new TestEnvironment ( ) ;
241
+ var trace2 = new NullTrace2 ( ) ;
242
242
var processManager = new TestProcessManager ( ) ;
243
- var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
243
+ var git = new GitProcess ( trace , trace2 , processManager , gitPath , repoPath ) ;
244
244
IGitConfiguration config = git . GetConfiguration ( ) ;
245
245
246
246
bool result = config . TryGet ( GitConfigurationLevel . Local , GitConfigurationType . Raw ,
@@ -258,9 +258,10 @@ public void GitConfiguration_Get_Name_Exists_ReturnsString()
258
258
259
259
string gitPath = GetGitPath ( ) ;
260
260
var trace = new NullTrace ( ) ;
261
- var env = new TestEnvironment ( ) ;
261
+ var trace2 = new NullTrace2 ( ) ;
262
262
var processManager = new TestProcessManager ( ) ;
263
- var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
263
+
264
+ var git = new GitProcess ( trace , trace2 , processManager , gitPath , repoPath ) ;
264
265
IGitConfiguration config = git . GetConfiguration ( ) ;
265
266
266
267
string value = config . Get ( "user.name" ) ;
@@ -275,9 +276,9 @@ public void GitConfiguration_Get_Name_DoesNotExists_ThrowsException()
275
276
276
277
string gitPath = GetGitPath ( ) ;
277
278
var trace = new NullTrace ( ) ;
278
- var env = new TestEnvironment ( ) ;
279
+ var trace2 = new NullTrace2 ( ) ;
279
280
var processManager = new TestProcessManager ( ) ;
280
- var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
281
+ var git = new GitProcess ( trace , trace2 , processManager , gitPath , repoPath ) ;
281
282
IGitConfiguration config = git . GetConfiguration ( ) ;
282
283
283
284
string randomName = $ "{ Guid . NewGuid ( ) : N} .{ Guid . NewGuid ( ) : N} ";
@@ -291,16 +292,16 @@ public void GitConfiguration_Set_Local_SetsLocalConfig()
291
292
292
293
string gitPath = GetGitPath ( ) ;
293
294
var trace = new NullTrace ( ) ;
294
- var env = new TestEnvironment ( ) ;
295
+ var trace2 = new NullTrace2 ( ) ;
295
296
var processManager = new TestProcessManager ( ) ;
296
- var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
297
+ var git = new GitProcess ( trace , trace2 , processManager , gitPath , repoPath ) ; ;
297
298
IGitConfiguration config = git . GetConfiguration ( ) ;
298
299
299
300
config . Set ( GitConfigurationLevel . Local , "core.foobar" , "foo123" ) ;
300
301
301
302
GitResult localResult = ExecGit ( repoPath , workDirPath , "config --local core.foobar" ) ;
302
303
303
- Assert . Equal ( "foo123" , localResult . StandardOutput . Trim ( ) ) ;
304
+ Assert . Equal ( "foo123" , localResult . StandardOutput . Trim ( ) ) ;
304
305
}
305
306
306
307
[ Fact ]
@@ -310,12 +311,13 @@ public void GitConfiguration_Set_All_ThrowsException()
310
311
311
312
string gitPath = GetGitPath ( ) ;
312
313
var trace = new NullTrace ( ) ;
313
- var env = new TestEnvironment ( ) ;
314
+ var trace2 = new NullTrace2 ( ) ;
314
315
var processManager = new TestProcessManager ( ) ;
315
- var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
316
+ var git = new GitProcess ( trace , trace2 , processManager , gitPath , repoPath ) ;
316
317
IGitConfiguration config = git . GetConfiguration ( ) ;
317
318
318
- Assert . Throws < InvalidOperationException > ( ( ) => config . Set ( GitConfigurationLevel . All , "core.foobar" , "test123" ) ) ;
319
+ Assert . Throws < InvalidOperationException > ( ( ) =>
320
+ config . Set ( GitConfigurationLevel . All , "core.foobar" , "test123" ) ) ;
319
321
}
320
322
321
323
[ Fact ]
@@ -324,15 +326,14 @@ public void GitConfiguration_Unset_Global_UnsetsGlobalConfig()
324
326
string repoPath = CreateRepository ( out string workDirPath ) ;
325
327
try
326
328
{
327
-
328
329
ExecGit ( repoPath , workDirPath , "config --global core.foobar alice" ) . AssertSuccess ( ) ;
329
330
ExecGit ( repoPath , workDirPath , "config --local core.foobar bob" ) . AssertSuccess ( ) ;
330
331
331
332
string gitPath = GetGitPath ( ) ;
332
333
var trace = new NullTrace ( ) ;
333
- var env = new TestEnvironment ( ) ;
334
+ var trace2 = new NullTrace2 ( ) ;
334
335
var processManager = new TestProcessManager ( ) ;
335
- var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
336
+ var git = new GitProcess ( trace , trace2 , processManager , gitPath , repoPath ) ;
336
337
IGitConfiguration config = git . GetConfiguration ( ) ;
337
338
338
339
config . Unset ( GitConfigurationLevel . Global , "core.foobar" ) ;
@@ -362,9 +363,9 @@ public void GitConfiguration_Unset_Local_UnsetsLocalConfig()
362
363
363
364
string gitPath = GetGitPath ( ) ;
364
365
var trace = new NullTrace ( ) ;
365
- var env = new TestEnvironment ( ) ;
366
+ var trace2 = new NullTrace2 ( ) ;
366
367
var processManager = new TestProcessManager ( ) ;
367
- var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
368
+ var git = new GitProcess ( trace , trace2 , processManager , gitPath , repoPath ) ;
368
369
IGitConfiguration config = git . GetConfiguration ( ) ;
369
370
370
371
config . Unset ( GitConfigurationLevel . Local , "core.foobar" ) ;
@@ -389,9 +390,9 @@ public void GitConfiguration_Unset_All_ThrowsException()
389
390
390
391
string gitPath = GetGitPath ( ) ;
391
392
var trace = new NullTrace ( ) ;
392
- var env = new TestEnvironment ( ) ;
393
+ var trace2 = new NullTrace2 ( ) ;
393
394
var processManager = new TestProcessManager ( ) ;
394
- var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
395
+ var git = new GitProcess ( trace , trace2 , processManager , gitPath , repoPath ) ;
395
396
IGitConfiguration config = git . GetConfiguration ( ) ;
396
397
397
398
Assert . Throws < InvalidOperationException > ( ( ) => config . Unset ( GitConfigurationLevel . All , "core.foobar" ) ) ;
@@ -407,9 +408,9 @@ public void GitConfiguration_UnsetAll_UnsetsAllConfig()
407
408
408
409
string gitPath = GetGitPath ( ) ;
409
410
var trace = new NullTrace ( ) ;
410
- var env = new TestEnvironment ( ) ;
411
+ var trace2 = new NullTrace2 ( ) ;
411
412
var processManager = new TestProcessManager ( ) ;
412
- var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
413
+ var git = new GitProcess ( trace , trace2 , processManager , gitPath , repoPath ) ;
413
414
IGitConfiguration config = git . GetConfiguration ( ) ;
414
415
415
416
config . UnsetAll ( GitConfigurationLevel . Local , "core.foobar" , "foo*" ) ;
@@ -426,12 +427,14 @@ public void GitConfiguration_UnsetAll_All_ThrowsException()
426
427
427
428
string gitPath = GetGitPath ( ) ;
428
429
var trace = new NullTrace ( ) ;
429
- var env = new TestEnvironment ( ) ;
430
+
431
+ var trace2 = new NullTrace2 ( ) ;
430
432
var processManager = new TestProcessManager ( ) ;
431
- var git = new GitProcess ( trace , processManager , gitPath , repoPath ) ;
433
+ var git = new GitProcess ( trace , trace2 , processManager , gitPath , repoPath ) ;
432
434
IGitConfiguration config = git . GetConfiguration ( ) ;
433
435
434
- Assert . Throws < InvalidOperationException > ( ( ) => config . UnsetAll ( GitConfigurationLevel . All , "core.foobar" , Constants . RegexPatterns . Any ) ) ;
436
+ Assert . Throws < InvalidOperationException > ( ( ) =>
437
+ config . UnsetAll ( GitConfigurationLevel . All , "core.foobar" , Constants . RegexPatterns . Any ) ) ;
435
438
}
436
439
}
437
440
}
0 commit comments