@@ -169,72 +169,71 @@ public override void OnSetup()
169169 [ Test ]
170170 public void GitLfsIsInstalledIfMissing ( )
171171 {
172- var gitInstallationPath = TestBasePath . Combine ( "GitInstall" ) . CreateDirectory ( ) ;
173-
174- var installDetails = new GitInstaller . GitInstallDetails ( gitInstallationPath , DefaultEnvironment . OnWindows )
175- {
176- GitPackageFeed = $ "http://localhost:{ server . Port } /unity/git/windows/{ GitInstaller . GitInstallDetails . GitPackageName } ",
177- GitLfsPackageFeed = $ "http://localhost:{ server . Port } /unity/git/windows/{ GitInstaller . GitInstallDetails . GitLfsPackageName } ",
178- } ;
172+ var tempZipExtractPath = TestBasePath . Combine ( "Temp" , "git_zip_extract_zip_paths" ) ;
173+ var gitInstallationPath = TestBasePath . Combine ( "GitInstall" ) . Combine ( GitInstaller . GitInstallDetails . GitDirectory ) ;
174+ var gitLfsInstallationPath = TestBasePath . Combine ( "GitInstall" ) . Combine ( GitInstaller . GitInstallDetails . GitLfsDirectory ) ;
179175
180- var package = Package . Load ( Environment , installDetails . GitPackageFeed ) ;
176+ var gitZipUri = new UriString ( $ "http://localhost: { server . Port } /unity/git/windows/git-slim.zip" ) ;
181177 var downloader = new Downloader ( ) ;
182- downloader . Catch ( e => true ) ;
183- downloader . QueueDownload ( package . Uri , installDetails . ZipPath ) ;
178+ downloader . QueueDownload ( gitZipUri , tempZipExtractPath ) ;
184179 downloader . RunWithReturn ( true ) ;
185180
186- var tempZipExtractPath = TestBasePath . Combine ( "Temp" , "git_zip_extract_zip_paths" ) ;
187-
188181 var gitExtractPath = tempZipExtractPath . Combine ( "git" ) . CreateDirectory ( ) ;
189- ZipHelper . Instance . Extract ( installDetails . GitZipPath , gitExtractPath , TaskManager . Token , null ) ;
182+ ZipHelper . Instance . Extract ( tempZipExtractPath . Combine ( gitZipUri . Filename ) , gitExtractPath , TaskManager . Token , null ) ;
190183 var source = gitExtractPath ;
191- var target = installDetails . GitInstallationPath ;
184+ var target = gitInstallationPath ;
192185 target . DeleteIfExists ( ) ;
193186 target . EnsureParentDirectoryExists ( ) ;
194187 source . Move ( target ) ;
195188
189+ var installDetails = new GitInstaller . GitInstallDetails ( gitInstallationPath . Parent , DefaultEnvironment . OnWindows )
190+ {
191+ GitPackageFeed = "http://nope" ,
192+ GitLfsPackageFeed = $ "http://localhost:{ server . Port } /unity/git/windows/{ GitInstaller . GitInstallDetails . GitLfsPackageName } ",
193+ } ;
194+
196195 var gitInstaller = new GitInstaller ( Environment , ProcessManager , TaskManager . Token , installDetails : installDetails ) ;
197196
198197 var result = gitInstaller . SetupGitIfNeeded ( ) ;
199198 result . Should ( ) . NotBeNull ( ) ;
200199
201- Assert . AreEqual ( gitInstallationPath . Combine ( GitInstaller . GitInstallDetails . GitDirectory ) , result . GitInstallationPath ) ;
202- result . GitExecutablePath . Should ( ) . Be ( gitInstallationPath . Combine ( GitInstaller . GitInstallDetails . GitDirectory , "cmd" , "git" + Environment . ExecutableExtension ) ) ;
203- result . GitLfsExecutablePath . Should ( ) . Be ( gitInstallationPath . Combine ( GitInstaller . GitInstallDetails . GitLfsDirectory , "git-lfs" + Environment . ExecutableExtension ) ) ;
200+ Assert . AreEqual ( gitInstallationPath , result . GitInstallationPath ) ;
201+ result . GitExecutablePath . Should ( ) . Be ( gitInstallationPath . Combine ( "cmd" , "git" + Environment . ExecutableExtension ) ) ;
202+ result . GitLfsExecutablePath . Should ( ) . Be ( gitLfsInstallationPath . Combine ( "git-lfs" + Environment . ExecutableExtension ) ) ;
204203 }
205204
206205 [ Test ]
207206 public void GitLfsIsInstalledIfMissingWithCustomGitPath ( )
208207 {
209- var defaultGitInstall = TestBasePath . Combine ( "DefaultInstall" ) . CreateDirectory ( ) ;
210- var customGitInstall = TestBasePath . Combine ( "CustomGitInstall" ) . CreateDirectory ( ) ;
211-
212- var installDetails = new GitInstaller . GitInstallDetails ( defaultGitInstall , DefaultEnvironment . OnWindows )
213- {
214- GitPackageFeed = $ "http://localhost:{ server . Port } /unity/git/windows/{ GitInstaller . GitInstallDetails . GitPackageName } ",
215- GitLfsPackageFeed = $ "http://localhost:{ server . Port } /unity/git/windows/{ GitInstaller . GitInstallDetails . GitLfsPackageName } ",
216- } ;
208+ var tempZipExtractPath = TestBasePath . Combine ( "Temp" , "git_zip_extract_zip_paths" ) ;
209+ var customGitInstall = TestBasePath . Combine ( "CustomGitInstall" ) . Combine ( GitInstaller . GitInstallDetails . GitDirectory ) ;
217210
218- var package = Package . Load ( Environment , installDetails . GitPackageFeed ) ;
211+ var gitZipUri = new UriString ( $ "http://localhost: { server . Port } /unity/git/windows/git-slim.zip" ) ;
219212 var downloader = new Downloader ( ) ;
220- downloader . Catch ( e => true ) ;
221- downloader . QueueDownload ( package . Uri , installDetails . ZipPath ) ;
213+ downloader . QueueDownload ( gitZipUri , tempZipExtractPath ) ;
222214 downloader . RunWithReturn ( true ) ;
223215
224- var tempZipExtractPath = TestBasePath . Combine ( "Temp" , "git_zip_extract_zip_paths" ) ;
225-
226216 var gitExtractPath = tempZipExtractPath . Combine ( "git" ) . CreateDirectory ( ) ;
227- ZipHelper . Instance . Extract ( installDetails . GitZipPath , gitExtractPath , TaskManager . Token , null ) ;
217+ ZipHelper . Instance . Extract ( tempZipExtractPath . Combine ( gitZipUri . Filename ) , gitExtractPath , TaskManager . Token , null ) ;
228218 var source = gitExtractPath ;
229219 var target = customGitInstall ;
230220 target . DeleteIfExists ( ) ;
231221 target . EnsureParentDirectoryExists ( ) ;
232222 source . Move ( target ) ;
233223 var gitExec = customGitInstall . Combine ( "cmd/git.exe" ) ;
224+
234225 var state = new GitInstaller . GitInstallationState ( ) ;
235226 state . GitExecutablePath = gitExec ;
236227 Environment . GitInstallationState = state ;
237228
229+ var defaultGitInstall = TestBasePath . Combine ( "DefaultInstall" ) ;
230+
231+ var installDetails = new GitInstaller . GitInstallDetails ( defaultGitInstall , DefaultEnvironment . OnWindows )
232+ {
233+ GitPackageFeed = "http://nope" ,
234+ GitLfsPackageFeed = $ "http://localhost:{ server . Port } /unity/git/windows/{ GitInstaller . GitInstallDetails . GitLfsPackageName } ",
235+ } ;
236+
238237 var gitInstaller = new GitInstaller ( Environment , ProcessManager , TaskManager . Token , installDetails : installDetails ) ;
239238
240239 state = gitInstaller . SetupGitIfNeeded ( ) ;
0 commit comments