Skip to content

fix: skip shadow repos for default branches - #11

Open
fengjikui wants to merge 1 commit into
lkonga:mainfrom
fengjikui:codex/skip-default-branch-shadow
Open

fix: skip shadow repos for default branches#11
fengjikui wants to merge 1 commit into
lkonga:mainfrom
fengjikui:codex/skip-default-branch-shadow

Conversation

@fengjikui

Copy link
Copy Markdown

Summary

  • fetch the repository default_branch before deciding whether branch search needs a shadow repo
  • skip shadow repo creation when the requested branch is already the default branch
  • make the existing source-guard tests read index.ts from the current checkout instead of an author-local absolute path
  • add regression coverage for default-branch, non-default, unavailable-default, disabled-branch-search, and omitted-branch decisions

Why

Issue #7 reports tmp-ghrtool-* shadow repos being created even for default branches. The execute path previously treated any provided branch as requiring shadow mode, so explicit main/dev requests could create a persistent shadow repo even when GitHub already indexes that branch as the repository default.

This keeps the old behavior when the default branch cannot be determined, so non-default branch search remains available instead of being silently skipped.

Partially addresses #7: this fixes default-branch detection. It does not attempt to solve shadow cleanup/TTL in the same change.

Validation

  • bun install
  • bun test (26 pass)
  • git diff --check

@fengjikui
fengjikui force-pushed the codex/skip-default-branch-shadow branch from a7c1d75 to 6d2d31b Compare July 7, 2026 23:38
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.

1 participant