Browse Source

repo: several minor improvements

1. Fix sample content didn't show up when hook doesn't exist.
2. Fix CSS 'word-break' to use 'break-word' not 'break-all'.
3. Fix single quote in 'locale_en-US.ini' file.
Unknwon 8 years ago
parent
commit
7de71333c6

+ 1 - 1
README.md

@@ -41,7 +41,7 @@ The goal of this project is to make the easiest, fastest, and most painless way
 - Reverse proxy with sub-path
 - Account/Organization/Repository management
 - Add/Remove repository collaborators
-- Repository/Organization webhooks (including Slack)
+- Repository/Organization webhooks (including Slack and Discord)
 - Repository Git hooks/deploy keys
 - Repository issues, pull requests, wiki and protected branches
 - Migrate and mirror repository and its wiki

+ 1 - 1
README_ZH.md

@@ -22,7 +22,7 @@ Gogs 的目标是打造一个最简单、最快速和最轻松的方式搭建自
 - 支持反向代理子路径
 - 支持用户、组织和仓库管理系统
 - 支持添加和删除仓库协作者
-- 支持仓库和组织级别 Web 钩子(包括 Slack 集成)
+- 支持仓库和组织级别 Web 钩子(包括 Slack 和 Discord 集成)
 - 支持仓库 Git 钩子和部署密钥
 - 支持仓库工单(Issue)、合并请求(Pull Request)、Wiki 和保护分支
 - 支持迁移和镜像仓库以及它的 Wiki

+ 1 - 1
cmd/web.go

@@ -95,7 +95,7 @@ func checkVersion() {
 		{"github.com/go-macaron/toolbox", toolbox.Version, "0.1.0"},
 		{"gopkg.in/ini.v1", ini.Version, "1.8.4"},
 		{"gopkg.in/macaron.v1", macaron.Version, "1.1.7"},
-		{"github.com/gogits/git-module", git.Version, "0.4.11"},
+		{"github.com/gogits/git-module", git.Version, "0.4.12"},
 		{"github.com/gogits/go-gogs-client", gogs.Version, "0.12.1"},
 	}
 	for _, c := range checkers {

+ 2 - 1
conf/locale/locale_en-US.ini

@@ -500,7 +500,7 @@ issues.new_label = New Label
 issues.new_label_placeholder = Label name...
 issues.create_label = Create Label
 issues.label_templates.title = Load a predefined set of labels
-issues.label_templates.info = There arent any labels yet. You can click on the "New Label" button above to create one or use a predefined set below.
+issues.label_templates.info = There aren't any labels yet. You can click on the "New Label" button above to create one or use a predefined set below.
 issues.label_templates.helper = Select a label set
 issues.label_templates.use = Use this label set
 issues.label_templates.fail_to_load_file = Failed to load label template file '%s': %v
@@ -656,6 +656,7 @@ settings.protect_require_pull_request = Require pull request instead direct push
 settings.protect_require_pull_request_desc = Enable this option to disable direct pushing to this branch. Commits have to be pushed to another non-protected branch and merged to this branch through pull request.
 settings.protect_whitelist_committers = Whitelist who can push to this branch
 settings.protect_whitelist_committers_desc = Add people or teams to whitelist of direct push to this branch.
+settings.update_protect_branch_success = Protect options for this branch has been updated successfully!
 settings.hooks = Webhooks
 settings.githooks = Git Hooks
 settings.basic_settings = Basic Settings

+ 1 - 1
gogs.go

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

+ 1 - 0
models/repo.go

@@ -122,6 +122,7 @@ func NewRepoContext() {
 		log.Fatal(4, "Gogs requires Git version greater or equal to 1.7.1")
 	}
 	git.HookDir = "custom_hooks"
+	git.HookSampleDir = "hooks"
 
 	// Git requires setting user.name and user.email in order to commit changes.
 	for configKey, defaultValue := range map[string]string{"user.name": "Gogs", "user.email": "gogs@fake.local"} {

File diff suppressed because it is too large
+ 4 - 4
modules/bindata/bindata.go


+ 1 - 1
public/css/gogs.css

@@ -910,7 +910,7 @@ footer .ui.language .menu {
   padding-top: .6em;
   padding-bottom: .6em;
   display: inline-block;
-  word-break: break-all;
+  word-break: break-word;
 }
 .ui.attached.header {
   background: #f0f0f0;

+ 1 - 1
public/less/_form.less

@@ -4,7 +4,7 @@
 	  padding-top: .6em;
 	  padding-bottom: .6em;
 	  display: inline-block;
-	  word-break: break-all;
+	  word-break: break-word;
 	}
 }
 .ui.attached.header {

+ 1 - 0
routers/repo/setting.go

@@ -462,6 +462,7 @@ func SettingsProtectedBranchPost(ctx *context.Context, form auth.ProtectBranchFo
 		return
 	}
 
+	ctx.Flash.Success(ctx.Tr("repo.settings.update_protect_branch_success"))
 	ctx.Redirect(fmt.Sprintf("%s/settings/branches/%s", ctx.Repo.RepoLink, branch))
 }
 

+ 1 - 1
templates/.VERSION

@@ -1 +1 @@
-0.9.160.0218
+0.9.160.0219

+ 1 - 1
vendor/github.com/gogits/git-module/git.go

@@ -10,7 +10,7 @@ import (
 	"time"
 )
 
-const _VERSION = "0.4.11"
+const _VERSION = "0.4.12"
 
 func Version() string {
 	return _VERSION

+ 10 - 4
vendor/github.com/gogits/git-module/hook.go

@@ -13,8 +13,9 @@ import (
 )
 
 var (
-	// Direcotry of hook file. Can be changed to "custom_hooks" for very purpose.
-	HookDir = "hooks"
+	// Direcotry of hook and sample files. Can be changed to "custom_hooks" for very purpose.
+	HookDir       = "hooks"
+	HookSampleDir = HookDir
 	// HookNames is a list of Git server hooks' name that are supported.
 	HookNames = []string{
 		"pre-receive",
@@ -62,8 +63,13 @@ func GetHook(repoPath, name string) (*Hook, error) {
 		}
 		h.IsActive = true
 		h.Content = string(data)
-	} else if isFile(h.path + ".sample") {
-		data, err := ioutil.ReadFile(h.path + ".sample")
+		return h, nil
+	}
+
+	// Check sample file
+	samplePath := path.Join(repoPath, HookSampleDir, h.name) + ".sample"
+	if isFile(samplePath) {
+		data, err := ioutil.ReadFile(samplePath)
 		if err != nil {
 			return nil, err
 		}

+ 3 - 3
vendor/vendor.json

@@ -159,10 +159,10 @@
 			"revisionTime": "2016-08-10T03:50:02Z"
 		},
 		{
-			"checksumSHA1": "JPQWxQRYFpezMThuSqcPhvbJdq4=",
+			"checksumSHA1": "RnWB5UDcTpSGepvWnwic1SyRZrc=",
 			"path": "github.com/gogits/git-module",
-			"revision": "c882f3d24df5fb730d3b3c1b6cc64416dd22660c",
-			"revisionTime": "2017-02-18T23:44:51Z"
+			"revision": "1b9552bab7499e5cbd96f6b550aaa0038faf6b67",
+			"revisionTime": "2017-02-19T18:16:29Z"
 		},
 		{
 			"checksumSHA1": "xvG+RgJODQqlmdAkHUQK2TyLR88=",

Some files were not shown because too many files changed in this diff