Let task agents create and manage subtasks
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user