Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,11 @@ class MultiRevisionRepositoryStrategy extends AbstractRepositoryStrategy {
}
final updateRevision = revision ?: getDefaultBranch(manifest)
log.debug "Fetching (updating) bare repo for ${project} [revision: $updateRevision]"
getBareGit().fetch().setRefSpecs(refSpecForName(updateRevision)).call()
final fetch = getBareGit().fetch().setRefSpecs(refSpecForName(updateRevision))
if( provider.hasCredentials() ) {
fetch.setCredentialsProvider(provider.getGitCredentials())
}
fetch.call()
}

private void createBareRepo(Manifest manifest) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ class AssetManagerTest extends Specification {

}

@Requires({System.getenv('NXF_GITHUB_ACCESS_TOKEN')})
def 'test download from tag twice with multi-revision'() {

given:
Expand Down Expand Up @@ -317,6 +318,26 @@ class AssetManagerTest extends Specification {
noExceptionThrown()
}

@Requires({System.getenv('NXF_AZURE_REPOS_TOKEN')})
def 'test download from branch twice with multi-revision private repo'() {

given:
def folder = tempDir.getRoot()
def token = System.getenv('NXF_AZURE_REPOS_TOKEN')

def manager = new AssetManager().build('https://dev.azure.com/pditommaso/nf-azure-repo', [providers: [azurerepos: [ auth: token]]])
manager.setStrategyType(AssetManager.RepositoryStrategyType.MULTI_REVISION)

when:
manager.download("master")
then:
folder.resolve(REPOS_SUBDIR + '/pditommaso/nf-azure-repo/nf-azure-repo/' + BARE_REPO).isDirectory()
when:
manager.download("master")
then:
noExceptionThrown()
}

// First clone a repo with a tag, then forget to include the -r argument
// when you execute nextflow.
// Note that while the download will work, execution will fail subsequently
Expand Down
Loading