Skip to content

Conversation

@robsyme
Copy link
Collaborator

@robsyme robsyme commented Jan 19, 2026

Summary

  • Fix bug where fetching a branch that exists on the remote but not in the local bare repository fails with "Remote does not have X available for fetch"
  • The refSpecForName() method now queries remote refs via lsRemote() when a revision is not found locally, before falling back to treating it as a commit SHA
  • Added @Memoized helper method fetchRemoteRefs() to cache results and avoid redundant network calls

Fixes #6732

Test plan

  • Added integration test should fetch new remote branch not in local bare repo that verifies fetching a branch not present locally
  • Added unit test should create correct RefSpec for branches tags and commits that verifies fallback behavior without network access
  • All existing SCM tests pass
  • Manual verification: nextflow pull nf-core/fetchngs -revision preview-26-04 now works correctly

🤖 Generated with Claude Code

…on mode

This test demonstrates the bug where trying to fetch a branch that exists
on the remote but not in the local bare repository fails.

Signed-off-by: Rob Syme <rob.syme@seqera.io>
Signed-off-by: Rob Syme <rob.syme@gmail.com>
…on mode

The refSpecForName method was only checking local refs in the bare
repository. For branches that exist on the remote but haven't been
fetched yet, this caused the method to incorrectly treat the branch
name as a commit SHA, resulting in a fetch error.

Now the method queries remote refs via ls-remote when the revision
is not found locally, allowing new remote branches to be fetched
correctly.

Fixes the error: 'Remote does not have <branch> available for fetch'

Signed-off-by: Rob Syme <rob.syme@seqera.io>
Signed-off-by: Rob Syme <rob.syme@gmail.com>
Signed-off-by: Rob Syme <rob.syme@seqera.io>
Signed-off-by: Rob Syme <rob.syme@gmail.com>
@netlify
Copy link

netlify bot commented Jan 19, 2026

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 7088496
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/696ec06baae663000869298e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fetching new remote branch fails in multi-revision mode

3 participants