summaryrefslogtreecommitdiffstats
path: root/models/pull.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-01-28 05:58:37 -0500
committerUnknwon <u@gogs.io>2016-01-28 05:58:37 -0500
commit0617720c0cd432d3160fed3f514b81d2967cf9aa (patch)
treecdd57aa806f7eedec921198df6b24b7db28d999c /models/pull.go
parent9b8ad01bc08bdcdb9aa69659215de4909aa8026c (diff)
parent674c5c37be53665db8ce549ece51c24129e695d9 (diff)
downloadgitea-0617720c0cd432d3160fed3f514b81d2967cf9aa.tar.gz
gitea-0617720c0cd432d3160fed3f514b81d2967cf9aa.zip
Merge pull request #2494 from mhartkorn/pullreq-name-change
Change user name in Pull Requests to avoid errors (fixes #2495)
Diffstat (limited to 'models/pull.go')
-rw-r--r--models/pull.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/models/pull.go b/models/pull.go
index 8497285e16..2fe7d1fe37 100644
--- a/models/pull.go
+++ b/models/pull.go
@@ -525,6 +525,14 @@ func AddTestPullRequestTask(repoID int64, branch string) {
}
}
+func ChangeUsernameInPullRequests(oldUserName, newUserName string) (error) {
+ pr := PullRequest{
+ HeadUserName : newUserName,
+ }
+ _, err := x.Cols("head_user_name").Where("head_user_name = ?", oldUserName).Update(pr)
+ return err
+}
+
// checkAndUpdateStatus checks if pull request is possible to levaing checking status,
// and set to be either conflict or mergeable.
func (pr *PullRequest) checkAndUpdateStatus() {