@@ -22,7 +22,7 @@ public void CanFetchIntoAnEmptyRepository(string url)
2222
2323 using ( var repo = new Repository ( path ) )
2424 {
25- Remote remote = repo . Network . Remotes . Add ( remoteName , url ) ;
25+ repo . Network . Remotes . Add ( remoteName , url ) ;
2626
2727 // Set up structures for the expected results
2828 // and verifying the RemoteUpdateTips callback.
@@ -44,7 +44,7 @@ public void CanFetchIntoAnEmptyRepository(string url)
4444 }
4545
4646 // Perform the actual fetch
47- repo . Network . Fetch ( remote , new FetchOptions { OnUpdateTips = expectedFetchState . RemoteUpdateTipsHandler } ) ;
47+ new Commands . Fetch ( repo , remoteName , new string [ 0 ] , new FetchOptions { OnUpdateTips = expectedFetchState . RemoteUpdateTipsHandler } , null ) . Run ( ) ;
4848
4949 // Verify the expected
5050 expectedFetchState . CheckUpdatedReferences ( repo ) ;
@@ -61,13 +61,13 @@ public void CanFetchIntoAnEmptyRepositoryWithCredentials()
6161
6262 using ( var repo = new Repository ( path ) )
6363 {
64- Remote remote = repo . Network . Remotes . Add ( remoteName , Constants . PrivateRepoUrl ) ;
64+ repo . Network . Remotes . Add ( remoteName , Constants . PrivateRepoUrl ) ;
6565
6666 // Perform the actual fetch
67- repo . Network . Fetch ( remote , new FetchOptions
67+ new Commands . Fetch ( repo , remoteName , new string [ 0 ] , new FetchOptions
6868 {
6969 CredentialsProvider = Constants . PrivateRepoCredentials
70- } ) ;
70+ } , null ) . Run ( ) ;
7171 }
7272 }
7373
@@ -81,7 +81,7 @@ public void CanFetchAllTagsIntoAnEmptyRepository(string url)
8181
8282 using ( var repo = new Repository ( path ) )
8383 {
84- Remote remote = repo . Network . Remotes . Add ( remoteName , url ) ;
84+ repo . Network . Remotes . Add ( remoteName , url ) ;
8585
8686 // Set up structures for the expected results
8787 // and verifying the RemoteUpdateTips callback.
@@ -101,10 +101,10 @@ public void CanFetchAllTagsIntoAnEmptyRepository(string url)
101101 }
102102
103103 // Perform the actual fetch
104- repo . Network . Fetch ( remote , new FetchOptions {
104+ new Commands . Fetch ( repo , remoteName , new string [ 0 ] , new FetchOptions {
105105 TagFetchMode = TagFetchMode . All ,
106106 OnUpdateTips = expectedFetchState . RemoteUpdateTipsHandler
107- } ) ;
107+ } , null ) . Run ( ) ;
108108
109109 // Verify the expected
110110 expectedFetchState . CheckUpdatedReferences ( repo ) ;
@@ -124,7 +124,7 @@ public void CanFetchCustomRefSpecsIntoAnEmptyRepository(string url, string local
124124
125125 using ( var repo = new Repository ( path ) )
126126 {
127- Remote remote = repo . Network . Remotes . Add ( remoteName , url ) ;
127+ repo . Network . Remotes . Add ( remoteName , url ) ;
128128
129129 string refSpec = string . Format ( "refs/heads/{2}:refs/remotes/{0}/{1}" , remoteName , localBranchName , remoteBranchName ) ;
130130
@@ -147,10 +147,10 @@ public void CanFetchCustomRefSpecsIntoAnEmptyRepository(string url, string local
147147 }
148148
149149 // Perform the actual fetch
150- repo . Network . Fetch ( remote , new string [ ] { refSpec } , new FetchOptions {
150+ new Commands . Fetch ( repo , remoteName , new string [ ] { refSpec } , new FetchOptions {
151151 TagFetchMode = TagFetchMode . None ,
152152 OnUpdateTips = expectedFetchState . RemoteUpdateTipsHandler
153- } ) ;
153+ } , null ) . Run ( ) ;
154154
155155 // Verify the expected
156156 expectedFetchState . CheckUpdatedReferences ( repo ) ;
@@ -181,7 +181,7 @@ public void FetchRespectsConfiguredAutoTagSetting(TagFetchMode tagFetchMode, int
181181 r => r . TagFetchMode = tagFetchMode ) ;
182182
183183 // Perform the actual fetch.
184- repo . Network . Fetch ( remote ) ;
184+ new Commands . Fetch ( repo , remoteName , new string [ 0 ] , null , null ) . Run ( ) ;
185185
186186 // Verify the number of fetched tags.
187187 Assert . Equal ( expectedTagCount , repo . Tags . Count ( ) ) ;
@@ -199,7 +199,7 @@ public void CanFetchAllTagsAfterAnInitialClone()
199199
200200 using ( var repo = new Repository ( clonedRepoPath ) )
201201 {
202- repo . Fetch ( "origin" , new FetchOptions { TagFetchMode = TagFetchMode . All } ) ;
202+ new Commands . Fetch ( repo , "origin" , new string [ 0 ] , new FetchOptions { TagFetchMode = TagFetchMode . All } , null ) . Run ( ) ;
203203 }
204204 }
205205
@@ -225,17 +225,17 @@ public void FetchHonorsTheFetchPruneConfigurationEntry()
225225
226226 // No pruning when the configuration entry isn't defined
227227 Assert . Null ( clonedRepo . Config . Get < bool > ( "fetch.prune" ) ) ;
228- clonedRepo . Fetch ( "origin" ) ;
228+ new Commands . Fetch ( clonedRepo , "origin" , new string [ 0 ] , null , null ) . Run ( ) ;
229229 Assert . Equal ( 5 , clonedRepo . Branches . Count ( b => b . IsRemote ) ) ;
230230
231231 // No pruning when the configuration entry is set to false
232232 clonedRepo . Config . Set < bool > ( "fetch.prune" , false ) ;
233- clonedRepo . Fetch ( "origin" ) ;
233+ new Commands . Fetch ( clonedRepo , "origin" , new string [ 0 ] , null , null ) . Run ( ) ;
234234 Assert . Equal ( 5 , clonedRepo . Branches . Count ( b => b . IsRemote ) ) ;
235235
236236 // Auto pruning when the configuration entry is set to true
237237 clonedRepo . Config . Set < bool > ( "fetch.prune" , true ) ;
238- clonedRepo . Fetch ( "origin" ) ;
238+ new Commands . Fetch ( clonedRepo , "origin" , new string [ 0 ] , null , null ) . Run ( ) ;
239239 Assert . Equal ( 4 , clonedRepo . Branches . Count ( b => b . IsRemote ) ) ;
240240 }
241241 }
0 commit comments