@@ -42,7 +42,7 @@ public void CanFetchIntoAnEmptyRepository(string url)
42
42
}
43
43
44
44
// Perform the actual fetch
45
- Comma
F438
nds . Fetch ( repo , remoteName , new string [ 0 ] , new FetchOptions { OnUpdateTips = expectedFetchState . RemoteUpdateTipsHandler } , null ) ;
45
+ Commands . Fetch ( repo , remoteName , Array . Empty < string > ( ) , new FetchOptions { OnUpdateTips = expectedFetchState . RemoteUpdateTipsHandler } , null ) ;
46
46
47
47
// Verify the expected
48
48
expectedFetchState . CheckUpdatedReferences ( repo ) ;
@@ -62,7 +62,7 @@ public void CanFetchIntoAnEmptyRepositoryWithCredentials()
62
62
repo . Network . Remotes . Add ( remoteName , Constants . PrivateRepoUrl ) ;
63
63
64
64
// Perform the actual fetch
65
- Commands . Fetch ( repo , remoteName , new string [ 0 ] , new FetchOptions
65
+ Commands . Fetch ( repo , remoteName , Array . Empty < string > ( ) , new FetchOptions
66
66
{
67
67
CredentialsProvider = Constants . PrivateRepoCredentials
68
68
} , null ) ;
@@ -98,7 +98,7 @@ public void CanFetchAllTagsIntoAnEmptyRepository(string url)
98
98
}
99
99
100
100
// Perform the actual fetch
101
- Commands . Fetch ( repo , remoteName , new string [ 0 ] , new FetchOptions
101
+ Commands . Fetch ( repo , remoteName , Array . Empty < string > ( ) , new FetchOptions
102
102
{
103
103
TagFetchMode = TagFetchMode . All ,
104
104
OnUpdateTips = expectedFetchState . RemoteUpdateTipsHandler
@@ -179,7 +179,7 @@ public void FetchRespectsConfiguredAutoTagSetting(TagFetchMode tagFetchMode, int
179
179
r => r . TagFetchMode = tagFetchMode ) ;
180
180
181
181
// Perform the actual fetch.
182
- Commands . Fetch ( repo , remoteName , new string [ 0 ] , null , null ) ;
182
+ Commands . Fetch ( repo , remoteName , Array . Empty < string > ( ) , null , null ) ;
183
183
184
184
// Verify the number of fetched tags.
185
185
Assert . Equal ( expectedTagCount , repo . Tags . Count ( ) ) ;
@@ -197,7 +197,7 @@ public void CanFetchAllTagsAfterAnInitialClone()
197
197
198
198
using ( var repo = new Repository ( clonedRepoPath ) )
199
199
{
200
- Commands . Fetch ( repo , "origin" , new string [ 0 ] , new FetchOptions { TagFetchMode = TagFetchMode . All } , null ) ;
200
+ Commands . Fetch ( repo , "origin" , Array . Empty < string > ( ) , new FetchOptions { TagFetchMode = TagFetchMode . All } , null ) ;
201
201
}
202
202
}
203
203
@@ -223,17 +223,17 @@ public void FetchHonorsTheFetchPruneConfigurationEntry()
223
223
224
224
// No pruning when the configuration entry isn't defined
225
225
Assert . Null ( clonedRepo . Config . Get < bool > ( "fetch.prune" ) ) ;
226
- Commands . Fetch ( clonedRepo , "origin" , new string [ 0 ] , null , null ) ;
226
+ Commands . Fetch ( clonedRepo , "origin" , Array . Empty < string > ( ) , null , null ) ;
227
227
Assert . Equal ( 5 , clonedRepo . Branches . Count ( b => b . IsRemote && b . FriendlyName != "origin/HEAD" ) ) ;
228
228
229
229
// No pruning when the configuration entry is set to false
230
230
clonedRepo . Config . Set < bool > ( "fetch.prune" , false ) ;
231
- Commands . Fetch ( clonedRepo , "origin" , new string [ 0 ] , null , null ) ;
231
+ Commands . Fetch ( clonedRepo , "origin" , Array . Empty < string > ( ) , null , null ) ;
232
232
Assert . Equal ( 5 , clonedRepo . Branches . Count ( b => b . IsRemote && b . FriendlyName != "origin/HEAD" ) ) ;
233
233
234
234
// Auto pruning when the configuration entry is set to true
235
235
clonedRepo . Config . Set < bool > ( "fetch.prune" , true ) ;
236
- Commands . Fetch ( clonedRepo , "origin" , new string [ 0 ] , null , null ) ;
236
+ Commands . Fetch ( clonedRepo , "origin" , Array . Empty < string > ( ) , null , null ) ;
237
237
Assert . Equal ( 4 , clonedRepo . Branches . Count ( b => b . IsRemote && b . FriendlyName != "origin/HEAD" ) ) ;
238
238
}
239
239
}
@@ -248,10 +248,10 @@ public void CannotFetchWithForbiddenCustomHeaders()
248
248
string clonedRepoPath = Repository . Clone ( url , scd . DirectoryPath ) ;
249
249
250
250
const string knownHeader = "User-Agent: mygit-201" ;
251
- var options = new FetchOptions { CustomHeaders = new String [ ] { knownHeader } } ;
251
+ var options = new FetchOptions { CustomHeaders = new string [ ] { knownHeader } } ;
252
252
using ( var repo = new Repository ( clonedRepoPath ) )
253
253
{
254
- Assert . Throws < LibGit2SharpException > ( ( ) => Commands . Fetch ( repo , "origin" , new string [ 0 ] , options , null ) ) ;
254
+ Assert . Throws < LibGit2SharpException > ( ( ) => Commands . Fetch ( repo , "origin" , Array . Empty < string > ( ) , options , null ) ) ;
255
255
}
256
256
}
257
257
@@ -265,10 +265,10 @@ public void CanFetchWithCustomHeaders()
265
265
string clonedRepoPath = Repository . Clone ( url , scd . DirectoryPath ) ;
266
266
267
267
const string knownHeader = "X-Hello: mygit-201" ;
268
- var options = new FetchOptions { CustomHeaders = new String [ ] { knownHeader } } ;
268
+ var options = new FetchOptions { CustomHeaders = new string [ ] { knownHeader } } ;
269
269
using ( var repo = new Repository ( clonedRepoPath ) )
270
270
{
271
- Commands . Fetch ( repo , "origin" , new string [ 0 ] , options , null ) ;
271
+ Commands . Fetch ( repo , "origin" , Array . Empty < string > ( ) , options , null ) ;
272
272
}
273
273
}
274
274
@@ -282,10 +282,10 @@ public void CannotFetchWithMalformedCustomHeaders()
282
282
string clonedRepoPath = Repository . Clone ( url , scd . DirectoryPath ) ;
283
283
284
284
const string knownHeader = "Hello world" ;
285
- var options = new FetchOptions { CustomHeaders = new String [ ] { knownHeader } } ;
285
+ var options = new FetchOptions { CustomHeaders = new string [ ] { knownHeader } } ;
286
286
using ( var repo = new Repository ( clonedRepoPath ) )
287
287
{
288
- Assert . Throws < LibGit2SharpException > ( ( ) => Commands . Fetch ( repo , "origin" , new string [ 0 ] , options , null ) ) ;
288
+ Assert . Throws < LibGit2SharpException > ( ( ) => Commands . Fetch ( repo , "origin" , Array . Empty < string > ( ) , options , null ) ) ;
289
289
}
290
290
}
291
291
0 commit comments