Let task agents create and manage subtasks

This commit is contained in:
Ian Gulliver
2026-10-16 10:36:38 -07:00
parent fd63a0dfbc
commit 0f2415570c
30 changed files with 1067 additions and 287 deletions
+14
View File
@@ -263,6 +263,20 @@ func Head(dir string) (string, error) {
return run(dir, "rev-parse", "HEAD")
}
func IsAncestor(dir, ancestor, descendant string) (bool, error) {
_, stderr, code, err := runCode(dir, nil, "merge-base", "--is-ancestor", ancestor, descendant)
if err != nil {
return false, err
}
switch code {
case 0:
return true, nil
case 1:
return false, nil
}
return false, fmt.Errorf("git merge-base --is-ancestor %s %s: exit status %d: %s", ancestor, descendant, code, stderr)
}
func ReadFile(repo, rev, path string) (string, bool, error) {
_, _, code, err := runCode(repo, nil, "cat-file", "-e", rev+":"+path)
if err != nil {