Skip to content

Commit 607b429

Browse files
committed
git-checkout: Invoke git fetch with --unshallow
Melange currently barfs on specific cherry-pick situations like the one at wolfi-dev/os#74858 . I spent some time investigating this and found that this happens because the initial `git clone` to fetch a tag is done in shallow mode, and then subsequent `git fetch` commands will be constrained by the "shallowness" that was created. I was surprised to find @smoser's #1473 which pretty much reached the same conclusion. My suggestion is that we should bite the bullet here and just invoke the `git fetch` that's run during `cherry-pick` using the `--unshallow` option. The downside is that this will pull in the entire repository history, which can be a lot in some cases. Signed-off-by: Sergio Durigan Junior <sergiodj@chainguard.dev>
1 parent f28e457 commit 607b429

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/build/pipelines/git-checkout.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ pipeline:
121121
if [ -n "$branch" ]; then
122122
case " $fetched_branches " in
123123
*" $branch "*) ;;
124-
*) vr git fetch origin $branch:$branch || {
124+
*) vr git fetch --unshallow origin $branch:$branch || {
125125
msg "failed to fetch branch $branch"
126126
return 1
127127
}

0 commit comments

Comments
 (0)