Repository navigation
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
With singleBranch: true and commitusingapi: true on a github scm, the target fails with:
✗ Something went wrong:
pulling remote branch object not found
It happens on the first run (no working branch yet, no pull request) and on later runs (working branch already exists). The commit has already been created on the remote working branch by then, so an existing pull request keeps being updated while the pipeline is reported as failed.
With singleBranch unset or false the same manifest works.
What I found by reading the code and reproducing:
- A single-branch clone is configured with only the cloned branch, for example
fetch = +refs/heads/main:refs/remotes/origin/mainin.git/config. - With
commitusingapi,Github.Commit()creates the commit through the GitHub API, then callsgitgeneric.Pull(..., singleBranch=true, forceReset=true)on the working branch. - go-git's
Worktree.PullContextfetches with the remote's configured refspec, so the working branch's new commit is never downloaded. It still resolves the commit hash from the remote's advertised refs and runs a fast-forward check, which fails withobject not foundbecause the objects are missing locally. PullOptions.SingleBranchdoes not change that fetch in go-git v5.19.2.- Related:
Checkoutcannot see an already published working branch in single-branch mode. It creates the local branch from the base branch instead of using the existing one, which a regular clone does through therefs/*:refs/*fetch.
Expected Behavior
singleBranch should only skip fetching unrelated references. The working branch should still be fetched when needed, and the pipeline should succeed like it does without singleBranch.
Steps To Reproduce
-
Create a GitHub repository with a
version.yamlfile (version: "0") and this manifestbump.yml:name: scratch bump scms: scratch: kind: github spec: user: '{{ requiredEnv "GITHUB_ACTOR" }}' username: '{{ requiredEnv "GITHUB_ACTOR" }}' owner: <owner> repository: <repo> token: '{{ requiredEnv "GITHUB_TOKEN" }}' commitusingapi: true branch: main force: false singleBranch: true actions: default: kind: github/pullrequest scmid: scratch spec: automerge: false title: 'scratch: bump version' sources: counter: kind: shell spec: command: date +%s%N targets: version: kind: yaml scmid: scratch sourceid: counter spec: file: version.yaml key: $.version
-
Run
GITHUB_TOKEN=<token> GITHUB_ACTOR=<user> updatecli apply --config bump.yml. -
See
pulling remote branch object not found. -
Set
singleBranch: false, remove/tmp/updatecli(it holds the previous single-branch clone), run again: it succeeds and opens a pull request.
A public repository with this setup: https://github.com/mallendem/updatecli-singlebranch-scratch
Environment
- OS: Fedora 44 (also seen on GitHub Actions ubuntu-latest)
- updatecli: v0.121.0 and current
main(7516688)
Anything else?
First seen in elastic/elastic-agent#16833, which enabled singleBranch for nightly bump workflows (about 20 minutes of clone time without it) and has been failing since. A fix is in progress: explicitly fetch the working branch in Pull and Checkout when singleBranch is set.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
olblak commentedon Oct 12, 2026
Thanks for opening the issue and a pullrequest, I'll try to find some time in the coming days to review it