Skip to content

Commit 85c118a

Browse files
authored
ssbc: Don't drop repo origin (#871)
I added this as a stopgap to prevent accidental token leakage to cause upstream pushes to be allowed. This has been fixed on the executor side by using a new clone mechanism for repos, so this is no longer required.
1 parent ef06271 commit 85c118a

1 file changed

Lines changed: 0 additions & 7 deletions

File tree

internal/batches/workspace/executor_workspace.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55

66
batcheslib "github.com/sourcegraph/sourcegraph/lib/batches"
7-
"github.com/sourcegraph/sourcegraph/lib/errors"
87

98
"github.com/sourcegraph/src-cli/internal/batches/graphql"
109
"github.com/sourcegraph/src-cli/internal/batches/repozip"
@@ -25,12 +24,6 @@ type executorWorkspaceCreator struct {
2524
var _ Creator = &executorWorkspaceCreator{}
2625

2726
func (wc *executorWorkspaceCreator) Create(ctx context.Context, repo *graphql.Repository, steps []batcheslib.Step, archive repozip.Archive) (Workspace, error) {
28-
// Cleanup the repo dir. We don't want any origin to be defined here. This
29-
// reduces risk of accidentally pushing anything from the workspace execution.
30-
if _, err := runGitCmd(ctx, wc.RepoDir, "remote", "rm", "origin"); err != nil {
31-
return nil, errors.Wrap(err, "git init failed")
32-
}
33-
3427
return &dockerBindExecutorWorkspace{
3528
dockerBindWorkspace: dockerBindWorkspace{
3629
tempDir: wc.TempDir,

0 commit comments

Comments
 (0)