Skip to content

Commit

Permalink
Merge pull request #3279 from mirpedrol/fix_3263
Browse files Browse the repository at this point in the history
General: Add hint to solve git errors with a synced repo
  • Loading branch information
mirpedrol authored Nov 14, 2024
2 parents 24e2dc2 + db11da5 commit 0848508
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
- handle new schema structure in `nf-core pipelines create-params-file` ([#3276](https://github.com/nf-core/tools/pull/3276))
- Update Gitpod image to use Miniforge instead of Miniconda([#3274](https://github.com/nf-core/tools/pull/3274))
- Update pre-commit hook astral-sh/ruff-pre-commit to v0.7.3 ([#3275](https://github.com/nf-core/tools/pull/3275))
- Add hint to solve git errors with a synced repo ([#3279](https://github.com/nf-core/tools/pull/3279))

## [v3.0.2 - Titanium Tapir Patch](https://github.com/nf-core/tools/releases/tag/3.0.2) - [2024-10-11]

Expand Down
12 changes: 10 additions & 2 deletions nf_core/synced_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,16 @@ def get_component_git_log(
old_component_path = Path("modules", component_name)
commits_old_iter = self.repo.iter_commits(max_count=depth, paths=old_component_path)

commits_old = [{"git_sha": commit.hexsha, "trunc_message": commit.message} for commit in commits_old_iter]
commits_new = [{"git_sha": commit.hexsha, "trunc_message": commit.message} for commit in commits_new_iter]
try:
commits_old = [{"git_sha": commit.hexsha, "trunc_message": commit.message} for commit in commits_old_iter]
commits_new = [{"git_sha": commit.hexsha, "trunc_message": commit.message} for commit in commits_new_iter]
except git.GitCommandError as e:
log.error(
f"Git error: {e}\n"
"To solve this, you can try to remove the cloned rempository and run the command again.\n"
f"This repository is typically found at `{self.local_repo_dir}`"
)
raise UserWarning
commits = iter(commits_new + commits_old)

return commits
Expand Down

0 comments on commit 0848508

Please sign in to comment.