Skip to content

Commit

Permalink
fix: Add some tracing when the worktree or index is unclean (#601)
Browse files Browse the repository at this point in the history
  • Loading branch information
codablock committed Jun 21, 2023
1 parent 4c8e436 commit b5c4d76
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/kluctl/commands/cmd_helm_update.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@ func (cmd *helmUpdateCmd) Run(ctx context.Context) error {
}
for pth, s := range gitStatus {
if strings.HasPrefix(pth, ".helm-charts/") {
status.Trace(ctx, "gitStatus=%s", gitStatus.String())
return fmt.Errorf("--commit can only be used when .helm-chart directory is clean")
}
if (s.Staging != git.Untracked && s.Staging != git.Unmodified) || (s.Worktree != git.Untracked && s.Worktree != git.Unmodified) {
status.Trace(ctx, "gitStatus=%s", gitStatus.String())
return fmt.Errorf("--commit can only be used when the git worktree is unmodified")
}
}
Expand Down

0 comments on commit b5c4d76

Please sign in to comment.