File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed
Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -177,7 +177,11 @@ class MultiRevisionRepositoryStrategy extends AbstractRepositoryStrategy {
177177 }
178178 final updateRevision = revision ?: getDefaultBranch(manifest)
179179 log. debug " Fetching (updating) bare repo for ${ project} [revision: $updateRevision ]"
180- getBareGit(). fetch(). setRefSpecs(refSpecForName(updateRevision)). call()
180+ final fetch = getBareGit(). fetch(). setRefSpecs(refSpecForName(updateRevision))
181+ if ( provider. hasCredentials() ) {
182+ fetch. setCredentialsProvider(provider. getGitCredentials())
183+ }
184+ fetch. call()
181185 }
182186
183187 private void createBareRepo (Manifest manifest ) {
Original file line number Diff line number Diff line change @@ -186,6 +186,7 @@ class AssetManagerTest extends Specification {
186186
187187 }
188188
189+ @Requires ({System .getenv(' NXF_GITHUB_ACCESS_TOKEN' )})
189190 def ' test download from tag twice with multi-revision' () {
190191
191192 given :
@@ -317,6 +318,26 @@ class AssetManagerTest extends Specification {
317318 noExceptionThrown()
318319 }
319320
321+ @Requires ({System .getenv(' NXF_AZURE_REPOS_TOKEN' )})
322+ def ' test download from branch twice with multi-revision private repo' () {
323+
324+ given :
325+ def folder = tempDir. getRoot()
326+ def token = System . getenv(' NXF_AZURE_REPOS_TOKEN' )
327+
328+ def manager = new AssetManager (). build(' https://dev.azure.com/pditommaso/nf-azure-repo' , [providers : [azurerepos : [ auth : token]]])
329+ manager. setStrategyType(AssetManager.RepositoryStrategyType . MULTI_REVISION )
330+
331+ when :
332+ manager. download(" master" )
333+ then :
334+ folder. resolve(REPOS_SUBDIR + ' /pditommaso/nf-azure-repo/nf-azure-repo/' + BARE_REPO ). isDirectory()
335+ when :
336+ manager. download(" master" )
337+ then :
338+ noExceptionThrown()
339+ }
340+
320341 // First clone a repo with a tag, then forget to include the -r argument
321342 // when you execute nextflow.
322343 // Note that while the download will work, execution will fail subsequently
You can’t perform that action at this time.
0 commit comments