Skip to content

fix(backup): fix bare repositories being skipped during pruning - #697

Merged
gabrie30 merged 5 commits into
gabrie30:masterfrom
psghahremani:fix/backup-mode-bare-repository-pruning
Aug 25, 2026
Merged

gabrie30 merged 5 commits into
gabrie30:masterfrom
psghahremani:fix/backup-mode-bare-repository-pruning

Conversation

@psghahremani

Copy link
Copy Markdown

Status

READY

Description

The current implementation of isGitRepository only looks for a .git subdirectory which is fine for standard clones, but doesn't work for bare/mirror clones (always returns false). Since the backup mode uses this function to filter existing directories for pruning, it ends up skipping all bare clones during the pruning process.

This PR:

  • Fixes isGitRepository's behavior by adding a secondary branch to detect bare clones using git rev-parse.
  • Updates TestPruneRepos in order to cover both types of clones.
  • Adds a setUpGitRepository helper for existing tests to create actual (but still temporary) repositories during the tests.

AI Assistance

Yes, Claude Sonnet 5. Mainly used for discovering the project and exploring the source code.

@gabrie30

Copy link
Copy Markdown
Owner

/ok-to-test

@gabrie30
gabrie30 enabled auto-merge (squash) August 25, 2026 14:23
@gabrie30
gabrie30 disabled auto-merge August 25, 2026 14:28
@gabrie30
gabrie30 merged commit f8b99a9 into gabrie30:master Aug 25, 2026
9 of 10 checks passed
@psghahremani
psghahremani deleted the fix/backup-mode-bare-repository-pruning branch October 20, 2026 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants