summaryrefslogtreecommitdiffstats
path: root/models/repo_redirect.go
diff options
context:
space:
mode:
authorkolaente <konrad@kola-entertainments.de>2019-06-12 21:41:28 +0200
committertechknowlogick <techknowlogick@gitea.io>2019-06-12 15:41:28 -0400
commitf9ec2f89f2265bc1371a6c62359de9816534fa6b (patch)
treef48b138a457e5ac6cf843bbb38400926704370f7 /models/repo_redirect.go
parent5832f8d90df2d72cb38698c3e9050f2b29717dc7 (diff)
downloadgitea-f9ec2f89f2265bc1371a6c62359de9816534fa6b.tar.gz
gitea-f9ec2f89f2265bc1371a6c62359de9816534fa6b.zip
Add golangci (#6418)
Diffstat (limited to 'models/repo_redirect.go')
-rw-r--r--models/repo_redirect.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/models/repo_redirect.go b/models/repo_redirect.go
index 813b3e6c9e..8847a0889c 100644
--- a/models/repo_redirect.go
+++ b/models/repo_redirect.go
@@ -4,7 +4,10 @@
package models
-import "strings"
+import (
+ "code.gitea.io/gitea/modules/log"
+ "strings"
+)
// RepoRedirect represents that a repo name should be redirected to another
type RepoRedirect struct {
@@ -38,7 +41,10 @@ func NewRepoRedirect(ownerID, repoID int64, oldRepoName, newRepoName string) err
}
if err := deleteRepoRedirect(sess, ownerID, newRepoName); err != nil {
- sess.Rollback()
+ errRollback := sess.Rollback()
+ if errRollback != nil {
+ log.Error("NewRepoRedirect sess.Rollback: %v", errRollback)
+ }
return err
}
@@ -47,7 +53,10 @@ func NewRepoRedirect(ownerID, repoID int64, oldRepoName, newRepoName string) err
LowerName: oldRepoName,
RedirectRepoID: repoID,
}); err != nil {
- sess.Rollback()
+ errRollback := sess.Rollback()
+ if errRollback != nil {
+ log.Error("NewRepoRedirect sess.Rollback: %v", errRollback)
+ }
return err
}
return sess.Commit()