Skip to content

fix(code): skip doomed master fetches when --pr-target-branch is stale - #23

Merged
danii1 merged 1 commit into
mainfrom
fix/explicit-master-target-on-main
Aug 19, 2026
Merged

fix(code): skip doomed master fetches when --pr-target-branch is stale#23
danii1 merged 1 commit into
mainfrom
fix/explicit-master-target-on-main

Conversation

@danii1

@danii1 danii1 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • DEV-74 only detected the repo default branch when --pr-target-branch was omitted. Copied cron/systemd examples still pass --pr-target-branch master, so startup ran git fetch origin master on main-only repos and only then fell back.
  • Resolve a missing explicit target (and pullLatestChanges) against the remote first, so a stale master/main flag never issues a doomed fetch.
  • Drop --pr-target-branch master from the documented cron/systemd examples; omit the flag unless targeting a non-default branch.

Test plan

  • bun run --filter @getdevintern/code test default-branch-detection.test.ts pull-latest-changes.test.ts
  • Confirm a scheduled run with --pr-target-branch master on this repo logs a fallback to main and does not print fatal: couldn't find remote ref master
  • Confirm omitting --pr-target-branch still prints Default branch detected as 'main' and pulls main

DEV-74 only resolved the default branch when --pr-target-branch was
omitted. Cron examples (and copied systemd units) pass --pr-target-branch
master, so startup still ran git fetch origin master on main-only repos
before falling back. Resolve a missing explicit target first, and stop
pullLatestChanges from fetching a ref the remote does not have.
@danii1
danii1 merged commit fe8455d into main Aug 19, 2026
1 check 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.

1 participant