Browse Source

repo: fix cannot fork repository (#4572)

Should not load attributes if repository not found in HasForkedRepo.
pull/4633/head
Unknwon 7 years ago
parent
commit
dc10594d7b
No known key found for this signature in database
GPG Key ID: 7A02C406FAC875A2
  1. 2
      gogs.go
  2. 4
      models/repo.go
  3. 2
      templates/.VERSION

2
gogs.go

@ -16,7 +16,7 @@ import (
"github.com/gogits/gogs/pkg/setting" "github.com/gogits/gogs/pkg/setting"
) )
const APP_VER = "0.11.26.0714" const APP_VER = "0.11.27.0718"
func init() { func init() {
setting.AppVer = APP_VER setting.AppVer = APP_VER

4
models/repo.go

@ -2262,8 +2262,10 @@ func HasForkedRepo(ownerID, repoID int64) (*Repository, bool, error) {
has, err := x.Where("owner_id = ? AND fork_id = ?", ownerID, repoID).Get(repo) has, err := x.Where("owner_id = ? AND fork_id = ?", ownerID, repoID).Get(repo)
if err != nil { if err != nil {
return nil, false, err return nil, false, err
} else if !has {
return nil, false, nil
} }
return repo, has, repo.LoadAttributes() return repo, true, repo.LoadAttributes()
} }
// ForkRepository creates a fork of target repository under another user domain. // ForkRepository creates a fork of target repository under another user domain.

2
templates/.VERSION

@ -1 +1 @@
0.11.26.0714 0.11.27.0718
Loading…
Cancel
Save