You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
#258's regression test writes the cooldown marker to a path the hook no longer reads, so every corrupt value passes trivially #324
test_a_corrupt_cooldown_marker_does_not_kill_the_hook (tests/test_git_backup_silent_stops_257.py) writes the marker to a path the hook no longer reads, so every corrupt value passes trivially and #258's regression is currently unguarded.
The mismatch
Test writes <store>/.last-git-backup-ts (:433).
Hook resolves the marker through _gb_common_dir and reads $GB_STATE_DIR/last-git-backup-ts, i.e. <store>/.git/remember/last-git-backup-ts (50-git-backup.sh:125, :155).
Confirmed by running a backup and globbing for the file rather than by reading the code:
The cleanup helper at the top of the same file already globs both names (:458-459), which looks like the trace of the path having moved.
Consequence
With the marker written where the hook reads it, 08 reaches the arithmetic and bash reports line 172: 08: value too great for base — the octal case a digits-only guard cannot catch. Written to the dotted path, the cooldown block is never entered at all, so the test asserts nothing about the guard it exists to protect.
Fixing the path is necessary but not sufficient
Measured on /bin/bash 3.2.57: with 08 at the real path the hook prints the octal diagnostic but still returns rc=0 and commits, because the failing arithmetic abandons the whole if/then body and $ELAPSED is never referenced. So the existing assertions (proc.returncode == 0, _slug_is_committed) stay green on the macOS leg while the same input behaves differently on newer bash.
Asserting on proc.stderr makes it fail on any version:
for_phrasein ("syntax error", "invalid arithmetic operator",
"value too great for base"):
assert_phrasenotinproc.stderr
With the path fixed and that assertion added, 08/09 fail against the current hook and pass once 10# is added after the existing case guard.
Scope
Filing this separately from #322 on purpose: it is a test-coverage bug in 50-git-backup.sh's suite, independent of the save-session.sh reads that issue is about. I have the patch and can open a PR if useful — say which you'd prefer.
Activity
fix(#324,#327): 10# in both git hooks, and #258's test writes where t…