Skip to content

fix: git resource reliability (default branch + panic-safe errors)#192

Open
bmdavis419 wants to merge 1 commit intomainfrom
codex/pr-a-git-resource-reliability
Open

fix: git resource reliability (default branch + panic-safe errors)#192
bmdavis419 wants to merge 1 commit intomainfrom
codex/pr-a-git-resource-reliability

Conversation

@bmdavis419
Copy link
Collaborator

@bmdavis419 bmdavis419 commented Feb 28, 2026

Summary

  • detect repo default branch when branch is omitted
  • improve branch omission UX in CLI add flow
  • prevent internal match-wrapper panic messages from surfacing to users

Issues

Greptile Summary

Improved git resource handling by auto-detecting repository default branches when not explicitly specified, and prevented internal panic-wrapper error messages from surfacing to users.

  • Auto-detects default branch using git ls-remote --symref when branch is omitted in CLI or API calls
  • Falls back to 'main' if detection fails, maintaining backwards compatibility
  • CLI now prompts with empty branch input and better descriptive text
  • Internal error messages like "match err handler threw" now display as user-friendly messages
  • Added proper git authentication support via BTCA_GIT_TOKEN environment variable
  • Tests updated to reflect new error message format

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Changes are well-structured with proper fallback handling, maintain backwards compatibility, and include test updates. The implementation is defensive with proper error handling and logging.
  • No files require special attention

Important Files Changed

Filename Overview
apps/cli/src/commands/add.ts Improved UX for branch input with auto-detection support - branch now optional with empty default
apps/server/src/errors.ts Added fallback wrapper message handling to prevent internal error messages from surfacing to users
apps/server/src/index.ts Added git default branch auto-detection with proper authentication and fallback to 'main'

Last reviewed commit: a77d7a6

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.

btca fails when repository default branch is not "main" Error: Unhandled exception: match err handler threw

1 participant