Add task summaries, closed-task search and a summary turn before discard

This commit is contained in:
Ian Gulliver
2026-10-16 10:08:08 -07:00
parent 2107a43ef2
commit fd63a0dfbc
25 changed files with 1013 additions and 268 deletions
+13 -1
View File
@@ -7,6 +7,7 @@ import (
"os"
"os/exec"
"path/filepath"
"slices"
"strconv"
"strings"
)
@@ -84,11 +85,22 @@ func RemoveDetachedWorktree(repo, path string) error {
}
func RemoveWorktree(repo, path, branch string) error {
_, err := run(repo, "worktree", "remove", "--force", path)
list, err := run(repo, "worktree", "list", "--porcelain")
if err != nil {
return err
}
_, statErr := os.Stat(path)
if statErr == nil || slices.Contains(strings.Split(list, "\n"), "worktree "+path) {
_, err = run(repo, "worktree", "remove", "--force", path)
if err != nil {
return err
}
}
_, _, code, err := runCode(repo, nil, "rev-parse", "--verify", "--quiet", "refs/heads/"+branch)
if err != nil || code != 0 {
return err
}
_, err = run(repo, "branch", "-D", branch)
return err
}