mirror of
https://github.com/x-motemen/ghq.git
synced 2026-09-10 07:26:27 -04:00
Return an error instead of logging it when failing to delete the worktree.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
8a99bf1670
commit
8506f1f526
|
|
@ -126,7 +126,7 @@ func doRm(ctx context.Context, cmd *cli.Command) error {
|
|||
gitCmd := exec.Command("git", "worktree", "remove", "--force", wt)
|
||||
gitCmd.Dir = p
|
||||
if out, gitErr := gitCmd.CombinedOutput(); gitErr != nil {
|
||||
logger.Log("warning", fmt.Sprintf("failed to remove worktree %s: %v\n%s", wt, gitErr, out))
|
||||
return fmt.Errorf("failed to remove worktree %s: %w\n%s", wt, gitErr, out)
|
||||
}
|
||||
}
|
||||
if err := os.RemoveAll(p); err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue