@@ -102,35 +102,54 @@ runVcsDriverContractSuite<GitVcsDriver.GitVcsDriver, GitContractError>({
102102 } ,
103103} ) ;
104104
105- it . effect ( "lists the fetch and push URLs of a partial clone remote" , ( ) =>
106- Effect . gen ( function * ( ) {
107- const fileSystem = yield * FileSystem . FileSystem ;
108- const cwd = yield * fileSystem . makeTempDirectoryScoped ( {
109- prefix : "t3-partial-clone-remotes-" ,
110- } ) ;
111- const driver = yield * GitVcsDriver . makeVcsDriverShape ( ) ;
112- yield * runGit ( cwd , [ "init" ] ) ;
113- yield * runGit ( cwd , [ "remote" , "add" , "origin" , "https://github.com/pingdotgg/t3code.git" ] ) ;
114- yield * runGit ( cwd , [
115- "remote" ,
116- "set-url" ,
117- "--push" ,
118- "origin" ,
119- "[email protected] :octocat/t3code.git" , 120- ] ) ;
121- yield * runGit ( cwd , [ "config" , "remote.origin.promisor" , "true" ] ) ;
122- yield * runGit ( cwd , [ "config" , "remote.origin.partialclonefilter" , "blob:none" ] ) ;
123-
124- const result = yield * driver . listRemotes ( cwd ) ;
125- assert . deepEqual ( result . remotes , [
126- {
127- name : "origin" ,
128- url : "https://github.com/pingdotgg/t3code.git" ,
129- pushUrl :
Option . some ( "[email protected] :octocat/t3code.git" ) , 130- isPrimary : true ,
131- } ,
132- ] ) ;
133- } ) . pipe ( Effect . scoped , Effect . provide ( layerGitContract ) ) ,
105+ it . effect . each ( [
106+ {
107+ fetchUrl : "https://github.com/pingdotgg/t3code.git" ,
108+ pushUrl :
"[email protected] :octocat/t3code.git" , 109+ lineEnding : "\n" ,
110+ } ,
111+ { fetchUrl : "../team repos/shared.git" , pushUrl : "../team repos/push.git" , lineEnding : "\n" } ,
112+ {
113+ fetchUrl : " ../team repos/shared (fetch) [blob:none].git " ,
114+ pushUrl : "../team repos/push (push).git\t" ,
115+ lineEnding : "\r\n" ,
116+ } ,
117+ ] ) (
118+ "lists the fetch and push URLs of a partial clone remote (%j)" ,
119+ ( { fetchUrl, pushUrl, lineEnding } ) =>
120+ Effect . gen ( function * ( ) {
121+ const fileSystem = yield * FileSystem . FileSystem ;
122+ const cwd = yield * fileSystem . makeTempDirectoryScoped ( {
123+ prefix : "t3-partial-clone-remotes-" ,
124+ } ) ;
125+ const process = yield * VcsProcess . VcsProcess ;
126+ const driver = yield * GitVcsDriver . makeVcsDriverShape ( ) . pipe (
127+ Effect . provideService ( VcsProcess . VcsProcess , {
128+ run : ( input ) =>
129+ process . run ( input ) . pipe (
130+ Effect . map ( ( result ) => ( {
131+ ...result ,
132+ stdout : result . stdout . replace ( / \r ? \n / g, lineEnding ) ,
133+ } ) ) ,
134+ ) ,
135+ } ) ,
136+ ) ;
137+ yield * runGit ( cwd , [ "init" ] ) ;
138+ yield * runGit ( cwd , [ "remote" , "add" , "origin" , fetchUrl ] ) ;
139+ yield * runGit ( cwd , [ "remote" , "set-url" , "--push" , "origin" , pushUrl ] ) ;
140+ yield * runGit ( cwd , [ "config" , "remote.origin.promisor" , "true" ] ) ;
141+ yield * runGit ( cwd , [ "config" , "remote.origin.partialclonefilter" , "blob:none" ] ) ;
142+
143+ const result = yield * driver . listRemotes ( cwd ) ;
144+ assert . deepEqual ( result . remotes , [
145+ {
146+ name : "origin" ,
147+ url : fetchUrl ,
148+ pushUrl : Option . some ( pushUrl ) ,
149+ isPrimary : true ,
150+ } ,
151+ ] ) ;
152+ } ) . pipe ( Effect . scoped , Effect . provide ( layerGitContract ) ) ,
134153) ;
135154
136155const makeCheckpointFixture = Effect . fn ( "makeCheckpointFixture" ) ( function * (
0 commit comments