Skip to content

[DEV-74] Avoid failed master branch lookups when the repository uses main - #18

Merged
danii1 merged 2 commits into
mainfrom
feature/dev-74
Aug 19, 2026
Merged

[DEV-74] Avoid failed master branch lookups when the repository uses main#18
danii1 merged 2 commits into
mainfrom
feature/dev-74

Conversation

@danii1

@danii1 danii1 commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Task: DEV-74

Summary: Avoid failed master branch lookups when the repository uses main

Implementation Details

Repository automations no longer assume the primary branch is master and then fail over to main after several Git errors.

  • Ask the remote for its authoritative default branch before checkout or fetch.
  • Use main immediately when that is the repository default; keep master and other configured defaults working.
  • Cache origin/HEAD as an offline fallback when a live probe cannot run.
  • Fetch a newly discovered remote default before creating a local tracking branch (for example after a mastermain rename).
  • Bound the remote HEAD probe and disable interactive Git/SSH prompts so unattended runs do not hang.
  • Add regression coverage for main, master, custom defaults, and a remote default-branch change.

This removes the noisy couldn't find remote ref master / pathspec 'master' did not match sequence from cron and JQL-driven workflows on repositories whose default branch is main.


This PR was automatically created by @devintern/code

devintern-internal[bot] added 2 commits August 19, 2026 10:31
Fetch newly discovered remote default branches before creating local tracking branches, with integration coverage for a master-to-main default change.

Bound the authoritative remote HEAD probe, disable interactive Git/SSH prompts, and verify cached origin/HEAD fallback on probe failure.

Iteration 2: address additional review feedback

Iteration 3: address additional review feedback

Iteration 4: address additional review feedback

Iteration 5: address additional review feedback
@danii1
danii1 merged commit c036620 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