()
| 4344 | } |
| 4345 | |
| 4346 | func gitWorkingTreeDirty() (bool, error) { |
| 4347 | out, err := exec.Command("git", "status", "--porcelain").Output() |
| 4348 | if err != nil { |
| 4349 | return false, fmt.Errorf("git status --porcelain: %w", err) |
| 4350 | } |
| 4351 | return strings.TrimSpace(string(out)) != "", nil |
| 4352 | } |
| 4353 | |
| 4354 | func runGitCheckout(ctx *snap.Context) error { |
| 4355 | if ctx.NArgs() > 1 { |