summaryrefslogtreecommitdiff
path: root/internal/executor
diff options
context:
space:
mode:
Diffstat (limited to 'internal/executor')
-rw-r--r--internal/executor/container.go37
1 files changed, 1 insertions, 36 deletions
diff --git a/internal/executor/container.go b/internal/executor/container.go
index ba0c03a..2c5b7d3 100644
--- a/internal/executor/container.go
+++ b/internal/executor/container.go
@@ -48,20 +48,7 @@ func (r *ContainerRunner) Run(ctx context.Context, t *task.Task, e *storage.Exec
var err error
repoURL := t.RepositoryURL
if repoURL == "" {
- repoURL = t.Agent.RepositoryURL
- }
- if repoURL == "" {
- // Fallback to project_dir if repository_url is not set (legacy support).
- // Prefer the 'local' bare remote so that git push succeeds after execution
- // (pushing to a non-bare working copy on a checked-out branch is rejected by git).
- if t.Agent.ProjectDir != "" {
- repoURL = t.Agent.ProjectDir
- if out, err2 := exec.Command("git", "-C", t.Agent.ProjectDir, "remote", "get-url", "local").Output(); err2 == nil {
- repoURL = strings.TrimSpace(string(out))
- }
- } else {
- return fmt.Errorf("task %s has no repository_url or project_dir", t.ID)
- }
+ return fmt.Errorf("task %s has no repository_url", t.ID)
}
image := t.Agent.ContainerImage
@@ -362,25 +349,3 @@ func (r *ContainerRunner) buildInnerCmd(t *task.Task, e *storage.Execution, isRe
return []string{"sh", "-c", claudeCmd.String()}
}
-
-func (r *ContainerRunner) fallbackGitInit(repoURL, workspace string) error {
- // Ensure directory exists
- if err := os.MkdirAll(workspace, 0755); err != nil {
- return err
- }
- // If it's a local directory but not a repo, init it.
- cmds := [][]string{
- gitSafe("-C", workspace, "init"),
- gitSafe("-C", workspace, "add", "-A"),
- gitSafe("-C", workspace, "commit", "--allow-empty", "-m", "chore: initial commit"),
- }
- // If it was a local path, maybe we should have copied it?
- // git clone handle local paths fine if they are repos.
- // This fallback is only if it's NOT a repo.
- for _, args := range cmds {
- if out, err := r.command(context.Background(), "git", args...).CombinedOutput(); err != nil {
- return fmt.Errorf("git init failed: %w\n%s", err, out)
- }
- }
- return nil
-}