Skip to content
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
- switch to uv and pyproject.toml ([#3925](https://github.com/nf-core/tools/pull/3925))
- Pin j178/prek-action action to 91fd7d7 ([#3931](https://github.com/nf-core/tools/pull/3931))
- add pre-commit hook to keep uv.lock in sync ([#3933](https://github.com/nf-core/tools/pull/3933))
- sync: don't overwrite the defaultBranch if already set in nextflow.config ([#3939](https://github.com/nf-core/tools/pull/3939))

### Template

Expand Down
5 changes: 3 additions & 2 deletions nf_core/pipelines/create/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ def __init__(
if self.config.outdir is None:
self.config.outdir = str(Path.cwd())

# Get the default branch name from the Git configuration
self.get_default_branch()
# Get the default branch name from the Git configuration if it was not parsed from nextflow.config previously
if self.default_branch == "master":
self.get_default_branch()

self.jinja_params, self.skip_areas = self.obtain_jinja_params_dict(
self.config.skip_features or [], str(self.config.outdir)
Expand Down
5 changes: 3 additions & 2 deletions nf_core/pipelines/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def inspect_sync_dir(self):
# Track ignored files to avoid processing them
self.ignored_files = self._get_ignored_files()

def get_wf_config(self):
def get_wf_config(self) -> None:
"""Check out the target branch if requested and fetch the nextflow config.
Check that we have the required config variables.
"""
Expand Down Expand Up @@ -290,7 +290,7 @@ def _clean_up_empty_dirs(self):
raise SyncExceptionError(e)
deleted.add(Path(curr_dir))

def make_template_pipeline(self):
def make_template_pipeline(self) -> None:
"""
Delete all files and make a fresh template using the workflow variables
"""
Expand All @@ -315,6 +315,7 @@ def make_template_pipeline(self):
from_config_file=True,
no_git=True,
force=True,
default_branch=self.wf_config.get("manifest.defaultBranch") or "master",
)
pipeline_create_obj.init_pipeline()

Expand Down