diff options
author | Unknwon <u@gogs.io> | 2016-08-27 13:37:55 -0700 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-08-27 13:37:55 -0700 |
commit | c30b856d147dd895507c8f2334a11ed4baab6c18 (patch) | |
tree | b0212b58f1026ba581f3f9c0ef1a366a5c4706df | |
parent | 13c106af7764a0b4757348ab4c82dbf9154ee11c (diff) | |
download | gitea-c30b856d147dd895507c8f2334a11ed4baab6c18.tar.gz gitea-c30b856d147dd895507c8f2334a11ed4baab6c18.zip |
#3505 use user’s info for committer and author
-rw-r--r-- | .gopmfile | 2 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | cmd/web.go | 2 | ||||
-rw-r--r-- | glide.lock | 2 | ||||
-rw-r--r-- | gogs.go | 2 | ||||
-rw-r--r-- | models/repo.go | 5 | ||||
-rw-r--r-- | models/repo_editor.go | 20 | ||||
-rw-r--r-- | models/user.go | 2 | ||||
-rw-r--r-- | models/wiki.go | 10 | ||||
-rw-r--r-- | templates/.VERSION | 2 |
10 files changed, 29 insertions, 20 deletions
@@ -18,7 +18,7 @@ github.com/go-xorm/core = commit:5bf745d github.com/go-xorm/xorm = commit:c6c7056 github.com/gogits/chardet = commit:2404f77 github.com/gogits/cron = commit:7f3990a -github.com/gogits/git-module = commit:7b206b5 +github.com/gogits/git-module = commit:0a18ab0 github.com/gogits/go-gogs-client = commit:c52f7ee github.com/issue9/identicon = commit:d36b545 github.com/jaytaylor/html2text = commit:52d9b78 @@ -3,7 +3,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra ![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true) -##### Current tip version: 0.9.88 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions) +##### Current tip version: 0.9.89 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions) | Web | UI | Preview | |:-------------:|:-------:|:-------:| diff --git a/cmd/web.go b/cmd/web.go index 06f94c787c..b4c63a53b5 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -88,7 +88,7 @@ func checkVersion() { {"github.com/go-macaron/toolbox", toolbox.Version, "0.1.0"}, {"gopkg.in/ini.v1", ini.Version, "1.8.4"}, {"gopkg.in/macaron.v1", macaron.Version, "1.1.7"}, - {"github.com/gogits/git-module", git.Version, "0.3.8"}, + {"github.com/gogits/git-module", git.Version, "0.4.0"}, {"github.com/gogits/go-gogs-client", gogs.Version, "0.12.1"}, } for _, c := range checkers { diff --git a/glide.lock b/glide.lock index f5bf62ed64..32c9ad698a 100644 --- a/glide.lock +++ b/glide.lock @@ -41,7 +41,7 @@ imports: - name: github.com/gogits/cron version: 7f3990acf1833faa5ebd0e86f0a4c72a4b5eba3c - name: github.com/gogits/git-module - version: 7b206b529a09ae8cfa1df52a6c0cdd2612cfc6fc + version: 0a18ab0f2b896dbf510de515a00a698a2de5719c - name: github.com/gogits/go-gogs-client version: c52f7ee0cc58d3cd6e379025552873a8df6de322 - name: github.com/issue9/identicon @@ -17,7 +17,7 @@ import ( "github.com/gogits/gogs/modules/setting" ) -const APP_VER = "0.9.88.0827" +const APP_VER = "0.9.89.0827" func init() { runtime.GOMAXPROCS(runtime.NumCPU()) diff --git a/models/repo.go b/models/repo.go index 14a5adeb55..1d425fe327 100644 --- a/models/repo.go +++ b/models/repo.go @@ -2303,7 +2303,10 @@ func (repo *Repository) UploadRepoFiles(doer *User, oldBranchName, branchName, t if err = git.AddChanges(localPath, true); err != nil { return fmt.Errorf("AddChanges: %v", err) - } else if err = git.CommitChanges(localPath, message, doer.NewGitSig()); err != nil { + } else if err = git.CommitChanges(localPath, git.CommitChangesOptions{ + Committer: doer.NewGitSig(), + Message: message, + }); err != nil { return fmt.Errorf("CommitChanges: %v", err) } else if err = git.Push(localPath, "origin", branchName); err != nil { return fmt.Errorf("Push: %v", err) diff --git a/models/repo_editor.go b/models/repo_editor.go index e89ad0a401..a773c8d36f 100644 --- a/models/repo_editor.go +++ b/models/repo_editor.go @@ -127,11 +127,11 @@ func (repo *Repository) UpdateRepoFile(doer *User, opts UpdateRepoFileOptions) ( if err = git.AddChanges(localPath, true); err != nil { return fmt.Errorf("git add --all: %v", err) - } - - signaure := doer.NewGitSig() - if err = git.CommitChanges(localPath, opts.Message, signaure); err != nil { - return fmt.Errorf("git commit -m %s --author='%s <%s>': %v", opts.Message, signaure.Name, signaure.Email, err) + } else if err = git.CommitChanges(localPath, git.CommitChangesOptions{ + Committer: doer.NewGitSig(), + Message: opts.Message, + }); err != nil { + return fmt.Errorf("CommitChanges: %v", err) } else if err = git.Push(localPath, "origin", opts.NewBranch); err != nil { return fmt.Errorf("git push origin %s: %v", opts.NewBranch, err) } @@ -254,11 +254,11 @@ func (repo *Repository) DeleteRepoFile(doer *User, opts DeleteRepoFileOptions) ( if err = git.AddChanges(localPath, true); err != nil { return fmt.Errorf("git add --all: %v", err) - } - - signaure := doer.NewGitSig() - if err = git.CommitChanges(localPath, opts.Message, signaure); err != nil { - return fmt.Errorf("git commit -m %s --author='%s <%s>': %v", opts.Message, signaure.Name, signaure.Email, err) + } else if err = git.CommitChanges(localPath, git.CommitChangesOptions{ + Committer: doer.NewGitSig(), + Message: opts.Message, + }); err != nil { + return fmt.Errorf("CommitChanges: %v", err) } else if err = git.Push(localPath, "origin", opts.Branch); err != nil { return fmt.Errorf("git push origin %s: %v", opts.Branch, err) } diff --git a/models/user.go b/models/user.go index 7ec5e12b2f..fa6bbacb7c 100644 --- a/models/user.go +++ b/models/user.go @@ -308,7 +308,7 @@ func (u *User) GetFollowing(page int) ([]*User, error) { // NewGitSig generates and returns the signature of given user. func (u *User) NewGitSig() *git.Signature { return &git.Signature{ - Name: u.Name, + Name: u.DisplayName(), Email: u.Email, When: time.Now(), } diff --git a/models/wiki.go b/models/wiki.go index 2f57eadda6..f62cd2ac79 100644 --- a/models/wiki.go +++ b/models/wiki.go @@ -129,7 +129,10 @@ func (repo *Repository) updateWikiPage(doer *User, oldTitle, title, content, mes } if err = git.AddChanges(localPath, true); err != nil { return fmt.Errorf("AddChanges: %v", err) - } else if err = git.CommitChanges(localPath, message, doer.NewGitSig()); err != nil { + } else if err = git.CommitChanges(localPath, git.CommitChangesOptions{ + Committer: doer.NewGitSig(), + Message: message, + }); err != nil { return fmt.Errorf("CommitChanges: %v", err) } else if err = git.Push(localPath, "origin", "master"); err != nil { return fmt.Errorf("Push: %v", err) @@ -165,7 +168,10 @@ func (repo *Repository) DeleteWikiPage(doer *User, title string) (err error) { if err = git.AddChanges(localPath, true); err != nil { return fmt.Errorf("AddChanges: %v", err) - } else if err = git.CommitChanges(localPath, message, doer.NewGitSig()); err != nil { + } else if err = git.CommitChanges(localPath, git.CommitChangesOptions{ + Committer: doer.NewGitSig(), + Message: message, + }); err != nil { return fmt.Errorf("CommitChanges: %v", err) } else if err = git.Push(localPath, "origin", "master"); err != nil { return fmt.Errorf("Push: %v", err) diff --git a/templates/.VERSION b/templates/.VERSION index a3ab1840a3..3c9e54a446 100644 --- a/templates/.VERSION +++ b/templates/.VERSION @@ -1 +1 @@ -0.9.88.0827
\ No newline at end of file +0.9.89.0827
\ No newline at end of file |