@@ -303,55 +303,12 @@ class GitRepositoryTests: XCTestCase {
303
303
}
304
304
}
305
305
306
- func testRemotes( ) {
307
- mktmpdir { path in
308
- // Create a repo.
309
- let testRepoPath = path. appending ( component: " test-repo " )
310
- try makeDirectories ( testRepoPath)
311
- initGitRepo ( testRepoPath)
312
- let repo = GitRepository ( path: testRepoPath)
313
-
314
- // There should be no remotes currently.
315
- XCTAssert ( try repo. remotes ( ) . isEmpty)
316
-
317
- // Add a remote via git cli.
318
- try systemQuietly ( [ Git . tool, " -C " , testRepoPath. asString, " remote " , " add " , " origin " , " ../foo " ] )
319
- // Test if it was added.
320
- XCTAssertEqual ( Dictionary ( items: try repo. remotes ( ) . map { ( $0, $1) } ) , [ " origin " : " ../foo " ] )
321
-
322
- // Remove the remote via cli.
323
- try systemQuietly ( [ Git . tool, " -C " , testRepoPath. asString, " remote " , " remove " , " origin " ] )
324
- // Test if it was removed.
325
- XCTAssert ( try repo. remotes ( ) . isEmpty)
326
-
327
- // Add a remote.
328
- try repo. add ( remote: " origin " , url: " ../foo " )
329
- // Check it was added.
330
- let remote = Dictionary ( items: try repo. remotes ( ) . map { ( $0, $1) } )
331
- XCTAssertEqual ( remote, [ " origin " : " ../foo " ] )
332
-
333
- // Add another remote.
334
- try repo. add ( remote: " origin2 " , url: " ../bar " )
335
- // Check that there are two remotes now.
336
- let remotes = Dictionary ( items: try repo. remotes ( ) . map { ( $0, $1) } )
337
- XCTAssertEqual ( remotes, [ " origin " : " ../foo " , " origin2 " : " ../bar " ] )
338
-
339
- // Remove the remotes.
340
- try repo. remove ( remote: " origin " )
341
- try repo. remove ( remote: " origin2 " )
342
-
343
- // All remotes should be removed now.
344
- XCTAssert ( try repo. remotes ( ) . isEmpty)
345
- }
346
- }
347
-
348
306
static var allTests = [
349
307
( " testFetch " , testFetch) ,
350
308
( " testRepositorySpecifier " , testRepositorySpecifier) ,
351
309
( " testProvider " , testProvider) ,
352
310
( " testGitRepositoryHash " , testGitRepositoryHash) ,
353
311
( " testRawRepository " , testRawRepository) ,
354
- ( " testRemotes " , testRemotes) ,
355
312
( " testGitFileView " , testGitFileView) ,
356
313
( " testCheckouts " , testCheckouts) ,
357
314
( " testHasUnpushedCommits " , testHasUnpushedCommits) ,
0 commit comments