Skip to content

Use git ls-remote for autoloop branch discovery - #20

Merged
mrjf merged 2 commits into
mainfrom
copilot/fix-branch-discovery-without-remotes
Apr 4, 2026
Merged

Use git ls-remote for autoloop branch discovery#20
mrjf merged 2 commits into
mainfrom
copilot/fix-branch-discovery-without-remotes

Conversation

CopilotAI commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

git branch -r --list origin/autoloop/* requires remote-tracking refs to be present locally, which they aren't in shallow checkouts (the default for actions/checkout). This causes the sync-branches workflow to silently find no branches.

Switch to git ls-remote --heads origin autoloop/* which queries the remote directly.

  • workflows/sync-branches.md — Replace git branch -r with git ls-remote --heads and update parsing for the <sha>\trefs/heads/<branch> output format
  • .github/workflows/sync-branches.lock.yml — Same change in the compiled Python version
// BeforeconstlistResult=git('branch','-r','--list','origin/autoloop/*');// ....map(b=>b.replace('origin/',''));// AfterconstlistResult=git('ls-remote','--heads','origin','autoloop/*');// ....map(b=>b.replace(/^.*refs\/heads\//,''));

CopilotAI linked an issue Apr 4, 2026 that may be closed by this pull request
@mrjf
mrjf marked this pull request as ready for review April 4, 2026 04:39
Replace `git branch -r --list origin/autoloop/*` with
`git ls-remote --heads origin autoloop/*` so that branch discovery
works in shallow checkouts where remote-tracking refs aren't present.
Agent-Logs-Url: https://github.com/githubnext/autoloop/sessions/2817cf91-682b-41fb-82c1-79eeb961f4f0
Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
CopilotAI changed the title [WIP] Fix branch discovery without remotesUse git ls-remote for autoloop branch discoveryApr 4, 2026
CopilotAI requested a review from mrjfApril 4, 2026 04:41
@mrjf
mrjf merged commit eba845f into mainApr 4, 2026
14 of 15 checks passed
Sign up for freeto 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.

branch discovery without remotes

2 participants

@mrjf