@@ -1025,6 +1025,68 @@ Task("Git-Fetch-Remote-Tags")
10251025 }
10261026} ) ;
10271027
1028+ Task ( "Git-Remotes" )
1029+ . IsDependentOn ( "Git-Modify-Commit" )
1030+ . Does ( ( ) =>
1031+ {
1032+ var originDir = testRepo . Combine ( Guid . NewGuid ( ) . ToString ( "d" ) ) ;
1033+ var testDir = testRepo . Combine ( Guid . NewGuid ( ) . ToString ( "d" ) ) ;
1034+
1035+ try
1036+ {
1037+ // Arrange: create a repo and a clone
1038+ GitClone ( ( IsRunningOnWindows ( ) ? "" : "file://" ) + testInitialRepo . FullPath , originDir ) ;
1039+ GitClone ( ( IsRunningOnWindows ( ) ? "" : "file://" ) + originDir . FullPath , testDir ) ;
1040+
1041+ // Act
1042+ var remotes = GitRemotes ( testDir ) ;
1043+
1044+ // Assert
1045+ Information ( "Found remotes: {0}" , string . Join ( ", " , remotes . Select ( x => x . Name + " -> " + x . Url ) ) ) ;
1046+ }
1047+ finally
1048+ {
1049+ // cleanup
1050+ var settings = new DeleteDirectorySettings {
1051+ Recursive = true ,
1052+ Force = true
1053+ } ;
1054+ DeleteDirectory ( originDir , settings ) ;
1055+ DeleteDirectory ( testDir , settings ) ;
1056+ }
1057+ } ) ;
1058+
1059+ Task ( "Git-Remote" )
1060+ . IsDependentOn ( "Git-Modify-Commit" )
1061+ . Does ( ( ) =>
1062+ {
1063+ var originDir = testRepo . Combine ( Guid . NewGuid ( ) . ToString ( "d" ) ) ;
1064+ var testDir = testRepo . Combine ( Guid . NewGuid ( ) . ToString ( "d" ) ) ;
1065+
1066+ try
1067+ {
1068+ // Arrange: create a repo and a clone
1069+ GitClone ( ( IsRunningOnWindows ( ) ? "" : "file://" ) + testInitialRepo . FullPath , originDir ) ;
1070+ GitClone ( ( IsRunningOnWindows ( ) ? "" : "file://" ) + originDir . FullPath , testDir ) ;
1071+
1072+ // Act
1073+ var remote = GitRemote ( testDir , "origin" ) ;
1074+
1075+ // Assert
1076+ Information ( "Found remote: {0}" , remote . Url ) ;
1077+ }
1078+ finally
1079+ {
1080+ // cleanup
1081+ var settings = new DeleteDirectorySettings {
1082+ Recursive = true ,
1083+ Force = true
1084+ } ;
1085+ DeleteDirectory ( originDir , settings ) ;
1086+ DeleteDirectory ( testDir , settings ) ;
1087+ }
1088+ } ) ;
1089+
10281090Task ( "Git-Tag" )
10291091 . IsDependentOn ( "Git-Tag-Apply" )
10301092 . IsDependentOn ( "Git-Tag-Apply-Objectish" ) ;
@@ -1120,7 +1182,9 @@ Task("Default-Tests")
11201182 . IsDependentOn ( "Git-Clean" )
11211183 . IsDependentOn ( "Git-Config" )
11221184 . IsDependentOn ( "Git-ShortenSha" )
1123- . IsDependentOn ( "Git-Fetch-Remote" ) ;
1185+ . IsDependentOn ( "Git-Fetch-Remote" )
1186+ . IsDependentOn ( "Git-Remotes" )
1187+ . IsDependentOn ( "Git-Remote" ) ;
11241188
11251189Task ( "Local-Tests" )
11261190 . IsDependentOn ( "Git-Init" )
@@ -1160,7 +1224,9 @@ Task("Local-Tests")
11601224 . IsDependentOn ( "Git-Clean" )
11611225 . IsDependentOn ( "Git-Config" )
11621226 . IsDependentOn ( "Git-ShortenSha" )
1163- . IsDependentOn ( "Git-Fetch-Remote" ) ;
1227+ . IsDependentOn ( "Git-Fetch-Remote" )
1228+ . IsDependentOn ( "Git-Remotes" )
1229+ . IsDependentOn ( "Git-Remote" ) ;
11641230
11651231///////////////////////////////////////////////////////////////////////////////
11661232// EXECUTION
0 commit comments