Summary
Two private helpers do exactly the same job under different names:
- `storage/issues.py:_commit_with_identity`
- `storage/prs.py:_commit`
Both:
- Build a `-c user.name=... -c user.email=... commit-tree ` argv list.
- Add `-p ` for each parent.
- Optionally set `GIT_AUTHOR_DATE` / `GIT_COMMITTER_DATE` env vars from `authored_at`.
- Run the subprocess and return `stdout.strip()`.
The two implementations diverge only in cosmetic comments. The `prs.py` copy already has a comment saying "mirrors issues._commit_with_identity" — flagging the duplication.
Suggested approach
Hoist into `gitcabin.storage.repo.BareRepo` as a method (e.g. `commit_tree(...)`) or into a new module-level helper in `storage/_git_objects.py`. Both `storage/issues.py` and `storage/prs.py` import it.
While we're there: consider hoisting the small set of underscored tree-helpers (`_entries_of`, `_load_commit`, `_read_blob`, `_subtree_or_none`, `_TreeEntry`, `_write_tree`) that `storage/prs.py` already imports from `storage/issues.py` — same shape of cross-module-private-import would benefit from a shared home (see #N for the layering issue).
Severity
Pure refactor; no behavior change.
Summary
Two private helpers do exactly the same job under different names:
Both:
The two implementations diverge only in cosmetic comments. The `prs.py` copy already has a comment saying "mirrors issues._commit_with_identity" — flagging the duplication.
Suggested approach
Hoist into `gitcabin.storage.repo.BareRepo` as a method (e.g. `commit_tree(...)`) or into a new module-level helper in `storage/_git_objects.py`. Both `storage/issues.py` and `storage/prs.py` import it.
While we're there: consider hoisting the small set of underscored tree-helpers (`_entries_of`, `_load_commit`, `_read_blob`, `_subtree_or_none`, `_TreeEntry`, `_write_tree`) that `storage/prs.py` already imports from `storage/issues.py` — same shape of cross-module-private-import would benefit from a shared home (see #N for the layering issue).
Severity
Pure refactor; no behavior change.