refactor(core): consolidate git directory resolution and pause state management - #80
Merged
JacksonFergusonDev merged 1 commit intoAug 22, 2026
Conversation
…management - Add get_git_dir helper in git_wrapper.py and remove duplicate _get_git_dir definitions from ops.py, daemon.py, and cli.py - Add ops.is_repo_paused and ops.set_repo_paused to centralize repository pause sentinel handling - Update daemon and cli modules to use the centralized pause helpers and get_git_dir - Add unit tests for get_git_dir resolution and pause state operations
JacksonFergusonDev
deleted the
refactor/consolidate-git-dir-and-pause-state
branch
August 22, 2026 18:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR addresses DRY (Don't Repeat Yourself) violations in Git directory resolution and repository pause state management:
Centralize Git Directory Resolution:
_get_git_dir(repo_path: Path) -> Pathhelper definitions acrossops.py,daemon.py, andcli.pywith a top-levelget_git_dir(repo_path: Path) -> Pathingit_wrapper.py.daemon.py(temporary_index,is_repo_busy),cli.py(_check_git_hooks), andops.py(get_drift_state,set_drift_state).Encapsulate Repository Pause State Handling:
ops.is_repo_paused(repo_path: Path) -> boolandops.set_repo_paused(repo_path: Path, paused: bool) -> None..git/pulsar_pausedsentinel checking and file operations acrossdaemon._should_skip,cli._check_repo_health,cli.show_status,cli.list_repos,cli.set_pause_state, andcli.run_doctor.Automated Tests:
test_git_wrapper.pyverifyingget_git_diragainst standard repositories, worktrees, and non-git fallback directories.test_ops.pyvalidatingis_repo_pausedandset_repo_pausedbehavior.Verification
ruff check,ruff format,mypy) passing cleanly.