summaryrefslogtreecommitdiff
path: root/internal/executor/container.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/executor/container.go')
-rw-r--r--internal/executor/container.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/internal/executor/container.go b/internal/executor/container.go
index 39f737a..a00448c 100644
--- a/internal/executor/container.go
+++ b/internal/executor/container.go
@@ -437,7 +437,7 @@ func (r *ContainerRunner) runContainer(ctx context.Context, t *task.Task, e *sto
} else {
// No commits pushed — check whether the agent left uncommitted work behind.
// If so, fail loudly: the work would be silently lost when the sandbox is deleted.
- if err := detectUncommittedChanges(workspace); err != nil {
+ if err := r.detectUncommittedChanges(ctx, workspace); err != nil {
return err
}
r.Logger.Info("no new commits to push", "taskID", t.ID)
@@ -610,9 +610,9 @@ func isScaffold(path string) bool {
// untracked source files that the agent forgot to commit. Scaffold files written by
// the harness (.claudomator-env, .claudomator-instructions.txt, .agent-home/) are
// excluded from the check.
-func detectUncommittedChanges(workspace string) error {
+func (r *ContainerRunner) detectUncommittedChanges(ctx context.Context, workspace string) error {
// Modified or staged tracked files
- diffOut, err := exec.Command("git", "-c", "safe.directory=*", "-C", workspace,
+ diffOut, err := r.command(ctx, "git", "-c", "safe.directory=*", "-C", workspace,
"diff", "--name-only", "HEAD").CombinedOutput()
if err == nil {
for _, line := range strings.Split(strings.TrimSpace(string(diffOut)), "\n") {
@@ -623,7 +623,7 @@ func detectUncommittedChanges(workspace string) error {
}
// Untracked new source files (excludes gitignored files)
- lsOut, err := exec.Command("git", "-c", "safe.directory=*", "-C", workspace,
+ lsOut, err := r.command(ctx, "git", "-c", "safe.directory=*", "-C", workspace,
"ls-files", "--others", "--exclude-standard").CombinedOutput()
if err == nil {
var dirty []string