summaryrefslogtreecommitdiffstats
path: root/modules/repository/generate.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/repository/generate.go')
-rw-r--r--modules/repository/generate.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/repository/generate.go b/modules/repository/generate.go
index 8f0b3c16fe..1436d764f0 100644
--- a/modules/repository/generate.go
+++ b/modules/repository/generate.go
@@ -177,9 +177,9 @@ func generateRepoCommit(ctx context.Context, repo, templateRepo, generateRepo *r
}
repoPath := repo.RepoPath()
- if stdout, err := git.NewCommand(ctx, "remote", "add", "origin", repoPath).
+ if stdout, _, err := git.NewCommand(ctx, "remote", "add", "origin", repoPath).
SetDescription(fmt.Sprintf("generateRepoCommit (git remote add): %s to %s", templateRepoPath, tmpDir)).
- RunInDirWithEnv(tmpDir, env); err != nil {
+ RunStdString(&git.RunOpts{Dir: tmpDir, Env: env}); err != nil {
log.Error("Unable to add %v as remote origin to temporary repo to %s: stdout %s\nError: %v", repo, tmpDir, stdout, err)
return fmt.Errorf("git remote add: %v", err)
}
@@ -292,9 +292,9 @@ func GenerateRepository(ctx context.Context, doer, owner *user_model.User, templ
return generateRepo, fmt.Errorf("checkDaemonExportOK: %v", err)
}
- if stdout, err := git.NewCommand(ctx, "update-server-info").
+ if stdout, _, err := git.NewCommand(ctx, "update-server-info").
SetDescription(fmt.Sprintf("GenerateRepository(git update-server-info): %s", repoPath)).
- RunInDir(repoPath); err != nil {
+ RunStdString(&git.RunOpts{Dir: repoPath}); err != nil {
log.Error("GenerateRepository(git update-server-info) in %v: Stdout: %s\nError: %v", generateRepo, stdout, err)
return generateRepo, fmt.Errorf("error in GenerateRepository(git update-server-info): %v", err)
}