Skip to content

Conversation

@stevebeattie
Copy link
Member

The commit 149f46c ("git-checkout: Invoke git fetch with --unshallow (#2258)") attempted to ensure that commits for cherry-picking could be found by adding the --unshallow argument; however this fails when cherry-picking multiple commits because calling git fetch --unshallow on a repo that is not a shallow checkout causes a fatal error:

[git checkout] Cherry-picked 582b4d7d62f1c512568649ce8b6db085a3d85a9f from main with comment: here comment
[git checkout] execute: git fetch --unshallow origin cpick:cpick
[git checkout] failed to fetch branch cpick
[git checkout] FAIL failed to apply cherry-pick
WARN fatal: --unshallow on a complete repository does not make sense

Fix this by only passing the --unshallow argument if the repository is in a shallow state and update the e2e tests to check for this condition.

fixes: 149f46c ("git-checkout: Invoke git fetch with --unshallow (#2258)")

The commit 149f46c ("git-checkout: Invoke `git fetch` with
`--unshallow` (chainguard-dev#2258)") attempted to ensure that commits for
cherry-picking could be found by adding the `--unshallow` argument;
however this fails when cherry-picking multiple commits because calling
`git fetch --unshallow` on a repo that is not a shallow checkout causes
a fatal error:

```
[git checkout] Cherry-picked 582b4d7d62f1c512568649ce8b6db085a3d85a9f from main with comment: here comment
[git checkout] execute: git fetch --unshallow origin cpick:cpick
[git checkout] failed to fetch branch cpick
[git checkout] FAIL failed to apply cherry-pick
WARN fatal: --unshallow on a complete repository does not make sense
```

Fix this by only passing the `--unshallow` argument if the repository is
in a shallow state and update the e2e tests to check for this condition.

fixes: 149f46c ("git-checkout: Invoke `git fetch` with `--unshallow` (chainguard-dev#2258)")
Signed-off-by: Steve Beattie <[email protected]>
@stevebeattie stevebeattie merged commit ad8c003 into chainguard-dev:main Jan 1, 2026
57 checks passed
@stevebeattie stevebeattie deleted the git-pipeline-multiple_cherrypicks branch January 5, 2026 03:02
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.

2 participants