Skip to content

Commit 561af8c

Browse files
committed
fix: Use force checkouts in git artifact. Fixes argoproj#14141
Avoids worktree contains unstaged changes error Signed-off-by: David Gamba <[email protected]>
1 parent dea9d0f commit 561af8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

workflow/artifacts/git/git.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func (g *ArtifactDriver) Load(inputArtifact *wfv1.Artifact, path string) error {
164164
if err != nil {
165165
return fmt.Errorf("failed to get resolve revision: %w", err)
166166
}
167-
if err := w.Checkout(&git.CheckoutOptions{Hash: plumbing.NewHash(h.String())}); err != nil {
167+
if err := w.Checkout(&git.CheckoutOptions{Hash: plumbing.NewHash(h.String()), Force: true}); err != nil {
168168
return fmt.Errorf("failed to checkout %q: %w", h, err)
169169
}
170170
}

0 commit comments

Comments
 (0)