Skip to content

Commit

Permalink
repo: fix cannot fork repository (#4572)
Browse files Browse the repository at this point in the history
Should not load attributes if repository not found in HasForkedRepo.
  • Loading branch information
unknwon committed Jul 18, 2017
1 parent e02fac4 commit dc10594
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gogs.go
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/gogits/gogs/pkg/setting"
)

const APP_VER = "0.11.26.0714"
const APP_VER = "0.11.27.0718"

func init() {
setting.AppVer = APP_VER
Expand Down
4 changes: 3 additions & 1 deletion models/repo.go
Expand Up @@ -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)
if err != nil {
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.
Expand Down
2 changes: 1 addition & 1 deletion templates/.VERSION
@@ -1 +1 @@
0.11.26.0714
0.11.27.0718

0 comments on commit dc10594

Please sign in to comment.