Skip to content

refactor: use getBranchWithProject() helper consistently#30

Merged
elitan merged 1 commit intomainfrom
refactor/use-getBranchWithProject-helper
Dec 26, 2025
Merged

refactor: use getBranchWithProject() helper consistently#30
elitan merged 1 commit intomainfrom
refactor/use-getBranchWithProject-helper

Conversation

@elitan
Copy link
Owner

@elitan elitan commented Dec 26, 2025

Summary

  • Replaces repeated branch lookup pattern with existing getBranchWithProject() helper across 5 files
  • Removes 73 lines of duplicate code
  • Cleans up unused imports

Changes

File Before After
snapshot/create.ts 15-line manual lookup Single getBranchWithProject() call
snapshot/cleanup.ts 15-line manual lookup Single getBranchWithProject() call
wal/info.ts 15-line manual lookup Single getBranchWithProject() call
wal/cleanup.ts 15-line manual lookup Single getBranchWithProject() call
branch/create.ts getProject() + manual find Single getBranchWithProject() call

Closes #17

Test plan

  • Build passes (bun run build)
  • All tests pass (bun run test)

🤖 Generated with Claude Code

Replaces repeated branch lookup pattern with existing getBranchWithProject()
helper across 5 files:

- snapshot/create.ts: replaced 15-line manual lookup pattern
- snapshot/cleanup.ts: replaced 15-line manual lookup pattern
- wal/info.ts: replaced 15-line manual lookup pattern
- wal/cleanup.ts: replaced 15-line manual lookup pattern
- branch/create.ts: replaced getProject() + manual find with single call

Also removed now-unused imports (UserError, CLI_NAME) from affected files.

Closes #17

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@elitan elitan merged commit b066a44 into main Dec 26, 2025
2 checks passed
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.

refactor: add getBranchOrFail() helper

1 participant