aboutsummaryrefslogtreecommitdiff
path: root/internal/db
diff options
context:
space:
mode:
authordependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>2022-04-05 16:45:01 +0800
committerGitHub <noreply@github.com>2022-04-05 16:45:01 +0800
commit2601b40ffaff032a95bbe777b6a80845e6041998 (patch)
tree1f760c8ac90aa3fcd0f2393010c4db519b24baf0 /internal/db
parent5acbd7bcc3eab97d4fc817b9e90aac6d92f22544 (diff)
mod: bump github.com/gogs/git-module from 1.5.0 to 1.6.0 (#6894)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Joe Chen <jc@unknwon.io>
Diffstat (limited to 'internal/db')
-rw-r--r--internal/db/repo.go4
-rw-r--r--internal/db/repo_editor.go72
2 files changed, 48 insertions, 28 deletions
diff --git a/internal/db/repo.go b/internal/db/repo.go
index 1c85583a..9f17b9a5 100644
--- a/internal/db/repo.go
+++ b/internal/db/repo.go
@@ -1980,7 +1980,9 @@ func GitFsck() {
repo := bean.(*Repository)
repoPath := repo.RepoPath()
err := git.Fsck(repoPath, git.FsckOptions{
- Args: conf.Cron.RepoHealthCheck.Args,
+ CommandOptions: git.CommandOptions{
+ Args: conf.Cron.RepoHealthCheck.Args,
+ },
Timeout: conf.Cron.RepoHealthCheck.Timeout,
})
if err != nil {
diff --git a/internal/db/repo_editor.go b/internal/db/repo_editor.go
index cf2426f6..71a8cfea 100644
--- a/internal/db/repo_editor.go
+++ b/internal/db/repo_editor.go
@@ -184,15 +184,21 @@ func (repo *Repository) UpdateRepoFile(doer *User, opts UpdateRepoFileOptions) (
return fmt.Errorf("commit changes on %q: %v", localPath, err)
}
- envs := ComposeHookEnvs(ComposeHookEnvsOptions{
- AuthUser: doer,
- OwnerName: repo.MustOwner().Name,
- OwnerSalt: repo.MustOwner().Salt,
- RepoID: repo.ID,
- RepoName: repo.Name,
- RepoPath: repo.RepoPath(),
- })
- if err = git.Push(localPath, "origin", opts.NewBranch, git.PushOptions{Envs: envs}); err != nil {
+ err = git.Push(localPath, "origin", opts.NewBranch,
+ git.PushOptions{
+ CommandOptions: git.CommandOptions{
+ Envs: ComposeHookEnvs(ComposeHookEnvsOptions{
+ AuthUser: doer,
+ OwnerName: repo.MustOwner().Name,
+ OwnerSalt: repo.MustOwner().Salt,
+ RepoID: repo.ID,
+ RepoName: repo.Name,
+ RepoPath: repo.RepoPath(),
+ }),
+ },
+ },
+ )
+ if err != nil {
return fmt.Errorf("git push origin %s: %v", opts.NewBranch, err)
}
return nil
@@ -289,15 +295,21 @@ func (repo *Repository) DeleteRepoFile(doer *User, opts DeleteRepoFileOptions) (
return fmt.Errorf("commit changes to %q: %v", localPath, err)
}
- envs := ComposeHookEnvs(ComposeHookEnvsOptions{
- AuthUser: doer,
- OwnerName: repo.MustOwner().Name,
- OwnerSalt: repo.MustOwner().Salt,
- RepoID: repo.ID,
- RepoName: repo.Name,
- RepoPath: repo.RepoPath(),
- })
- if err = git.Push(localPath, "origin", opts.NewBranch, git.PushOptions{Envs: envs}); err != nil {
+ err = git.Push(localPath, "origin", opts.NewBranch,
+ git.PushOptions{
+ CommandOptions: git.CommandOptions{
+ Envs: ComposeHookEnvs(ComposeHookEnvsOptions{
+ AuthUser: doer,
+ OwnerName: repo.MustOwner().Name,
+ OwnerSalt: repo.MustOwner().Salt,
+ RepoID: repo.ID,
+ RepoName: repo.Name,
+ RepoPath: repo.RepoPath(),
+ }),
+ },
+ },
+ )
+ if err != nil {
return fmt.Errorf("git push origin %s: %v", opts.NewBranch, err)
}
return nil
@@ -513,15 +525,21 @@ func (repo *Repository) UploadRepoFiles(doer *User, opts UploadRepoFileOptions)
return fmt.Errorf("commit changes on %q: %v", localPath, err)
}
- envs := ComposeHookEnvs(ComposeHookEnvsOptions{
- AuthUser: doer,
- OwnerName: repo.MustOwner().Name,
- OwnerSalt: repo.MustOwner().Salt,
- RepoID: repo.ID,
- RepoName: repo.Name,
- RepoPath: repo.RepoPath(),
- })
- if err = git.Push(localPath, "origin", opts.NewBranch, git.PushOptions{Envs: envs}); err != nil {
+ err = git.Push(localPath, "origin", opts.NewBranch,
+ git.PushOptions{
+ CommandOptions: git.CommandOptions{
+ Envs: ComposeHookEnvs(ComposeHookEnvsOptions{
+ AuthUser: doer,
+ OwnerName: repo.MustOwner().Name,
+ OwnerSalt: repo.MustOwner().Salt,
+ RepoID: repo.ID,
+ RepoName: repo.Name,
+ RepoPath: repo.RepoPath(),
+ }),
+ },
+ },
+ )
+ if err != nil {
return fmt.Errorf("git push origin %s: %v", opts.NewBranch, err)
}