Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Fixed in v2.1.1
This issue has been fixed in version 2.1.1. Here's what happened and how it was resolved:
Root Cause
The bug was introduced in PR #100 which added support for the
--use-fetchflag. The original implementation incorrectly added the--mirrorflag to git clone operations whenever--use-fetchwas enabled. This caused all repositories cloned with--use-fetchto be created as bare repositories (mirrors) instead of normal repositories with a working tree.The Fix
The fix separates the concerns of two different use cases:
--use-fetchflag: For users who want normal repositories (with working tree) but prefer usinggit fetchinstead ofgit pullfor updates. This is useful when you have local branches that no longer exist on the remote.--mirrorflag (new): For users who want bare mirror repositories for backup purposes. This automatically usesfetchinstead ofpullfor updates, as mirrors should always use fetch.Changes Made
--mirrorflag from--use-fetchclone operations--mirrorflag specifically for creating bare mirror repositoriespullmethod to check bothuse_fetchandmirrorflags (mirror implies use_fetch)Usage
For normal repositories with fetch updates:
For bare mirror repositories (backups):
Testing
All flag combinations have been thoroughly tested:
--use-fetchalone: normal repo, uses fetch--mirroralone: bare repo, uses fetchThe fix is available in v2.1.1 and has been tested to ensure backward compatibility while fixing the reported issue.
Note
Introduces --mirror for bare backups, decouples it from --use-fetch (which now only switches updates to fetch), propagates config/logic, updates docs, adds comprehensive tests, and bumps to v2.1.1.
--mirrorflag and plumbmirrorthroughgitlabber/cli.py,GitlabberConfig,GitlabTree, and git sync APIs (GitAction,GitActionCollector,GitSyncManager,sync_tree,get_git_actions).--use-fetchno longer adds--mirror;mirroradds--mirroron clone and implies fetch on update.use_fetchormirror.README.md,README.rst,docs/index.rstfor--use-fetchand new--mirror.use_fetch/mirrorcombinations and interactions; adjust helpers to mockfetch.pyproject.tomlto2.1.1.Written by Cursor Bugbot for commit 0319f8b. This will update automatically on new commits. Configure here.