Remove dead restic wrapper layer#12
Merged
Merged
Conversation
lib/restic.sh exported 30 wrapper functions around the restic binary, but the generated backup/restore/verify scripts call restic directly. Only four have real callers (get_restic_repo, init_restic_repo, repo_exists used by generators/setup; apply_retention_days used by backup.sh). The verify_quick/ verify_full copies were also shadowed by lib/verify.sh's later definitions. Drop the 30 dead functions and trim restic.bats to the surviving helpers. No behaviour change: every deleted function had zero production callers.
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
Part of a grouped dead-code cleanup (3 PRs, split by area so each can be reviewed independently). This PR removes the unused wrapper layer in
lib/restic.sh.lib/restic.shexported 30 functions wrapping theresticbinary, but the generated backup/restore/verify scripts callresticdirectly. Only four helpers have real callers:get_restic_repo,init_restic_repo,repo_exists— used bygenerators.shandsetup.shapply_retention_days— used bybackup.shThe
verify_quick/verify_fullcopies were additionally shadowed bylib/verify.sh's later definitions, so they could never run.Changes
lib/restic.sh(517 → 73 lines)tests/unit/restic.batsto the surviving helpersWhy it's safe
Every removed function was verified to have zero production callers (including inside the generated-script heredocs). No behaviour change.
Testing
./tests/run-tests.sh --syntax— 22 files pass./tests/run-tests.sh --unit— all unit tests passshellcheck -x -s bash -S warning backupd.sh lib/*.sh— cleanTargets
develop. Hold for green CI + review before merge.