aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2017-07-18 12:56:23 -0400
committerUnknwon <u@gogs.io>2017-07-18 12:56:23 -0400
commitdc10594d7b0f01cee5114789fa95c05596fe6d1e (patch)
tree189e0248ed082195afbeb95b35ae5270be5609ca
parente02fac4968574694927859105e67aac3f665481d (diff)
repo: fix cannot fork repository (#4572)
Should not load attributes if repository not found in HasForkedRepo.
-rw-r--r--gogs.go2
-rw-r--r--models/repo.go4
-rw-r--r--templates/.VERSION2
3 files changed, 5 insertions, 3 deletions
diff --git a/gogs.go b/gogs.go
index 6761e3d3..11267edd 100644
--- a/gogs.go
+++ b/gogs.go
@@ -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
diff --git a/models/repo.go b/models/repo.go
index 5a4deba4..d6205ca5 100644
--- a/models/repo.go
+++ b/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)
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.
diff --git a/templates/.VERSION b/templates/.VERSION
index f9caef96..b4c1f0c8 100644
--- a/templates/.VERSION
+++ b/templates/.VERSION
@@ -1 +1 @@
-0.11.26.0714 \ No newline at end of file
+0.11.27.0718 \ No newline at end of file