Skip to content

fix(repo-walker): exit 1 when a repo fails - #7

Merged
twistedmelonman merged 2 commits into
mainfrom
claude/fix-walker-exit-status-883a2e56
Oct 15, 2026
Merged

twistedmelonman merged 2 commits into
mainfrom
claude/fix-walker-exit-status-883a2e56

Conversation

@twistedmelonman

Copy link
Copy Markdown
Member

What was broken

my-repos and beacon-repos printed Failed: N and exited 0. A caller that checks the exit status saw success; allup worked around it by parsing the summary text (dotfiles#432).

Fix

repo_walker_main returns 1 when any repo failed its status check, switch, pull or branch restore. Dirty repos are still skipped with exit 0, a missing directory still exits 0, and report-only lookups (remote checks, dead-branch lookups) do not change the status. The wrappers call repo_walker_main last, so the status passes through.

The only caller is allup's _allup_pull_step, which already handles a non-zero exit. A follow-up dotfiles PR drops its summary parsing.

Tests

  • New: a failed pull exits 1 in both wrappers; a walk whose only repo is dirty exits 0. The first fails against the old library.
  • Two existing walk tests pull from a nonexistent GitHub repo; they now expect exit 1.
  • bats tests/repo-walker.bats: 87/87.

Closes #6

Claude Code Bot added 2 commits October 15, 2026 14:56
my-repos and beacon-repos printed "Failed: N" and exited 0, so a
caller checking the exit status saw success. allup worked around this
by parsing the summary text (dotfiles#432).

repo_walker_main now returns 1 when any repo failed its status check,
switch, pull or branch restore. Dirty repos are still skipped with
exit 0, and report-only lookups do not change the status. The wrappers
call repo_walker_main last, so the status passes through unchanged.

The only caller is allup's _allup_pull_step, which already handles a
non-zero exit.

Two existing walk tests pull from a GitHub repo that does not exist;
they now expect exit 1.

Closes #6
Review follow-up. The report-only walk test exits 1 because its fake
origin cannot be pulled, not because of the mis-pointed remote. Assert
Failed: 1 so the cause is explicit, and record why the test cannot
isolate a mis-pointed remote. README now lists every failure that sets
exit 1.
@twistedmelonman
twistedmelonman merged commit e1a0ef6 into main Oct 15, 2026
3 checks passed
@twistedmelonman
twistedmelonman deleted the claude/fix-walker-exit-status-883a2e56 branch October 15, 2026 22:01
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.

my-repos exits 0 when a pull fails

1 participant