From b2fb7e3fd27f360e65ee60b93cad7d5d9832f818 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sun, 22 Nov 2015 13:01:42 -0500 Subject: [PATCH] more HTTP clone word fix --- modules/template/template.go | 4 ++-- routers/repo/pull.go | 2 +- templates/repo/bare.tmpl | 2 +- templates/repo/home.tmpl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/template/template.go b/modules/template/template.go index 8d602760adc..37c7d793514 100644 --- a/modules/template/template.go +++ b/modules/template/template.go @@ -25,8 +25,8 @@ var Funcs template.FuncMap = map[string]interface{}{ "GoVer": func() string { return strings.Title(runtime.Version()) }, - "Protocol": func() string { - return string(setting.Protocol) + "UseHTTPS": func() bool { + return strings.HasPrefix(setting.AppUrl, "https") }, "AppName": func() string { return setting.AppName diff --git a/routers/repo/pull.go b/routers/repo/pull.go index ee66da73b0b..d7b4828a91b 100644 --- a/routers/repo/pull.go +++ b/routers/repo/pull.go @@ -448,7 +448,7 @@ func ParseCompareInfo(ctx *middleware.Context) (*models.User, *models.Repository // Check if current user has fork of repository. headRepo, has := models.HasForkedRepo(headUser.Id, repo.ID) - if !has || !ctx.User.IsAdminOfRepo(headRepo) { + if !has || (!ctx.User.IsAdminOfRepo(headRepo) && !ctx.User.IsAdmin) { ctx.Handle(404, "HasForkedRepo", nil) return nil, nil, nil, nil, "", "" } diff --git a/templates/repo/bare.tmpl b/templates/repo/bare.tmpl index e57420d8e5f..af839cbaf83 100644 --- a/templates/repo/bare.tmpl +++ b/templates/repo/bare.tmpl @@ -22,7 +22,7 @@ {{end}} {{end}}