diff options
author | Unknwon <u@gogs.io> | 2017-02-19 13:18:16 -0500 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2017-02-19 13:18:16 -0500 |
commit | 7de71333c655722c35a3e3e25e7769c0b292e27c (patch) | |
tree | 2de51200dd396545b114838d45fa4884f83f2c0e /vendor/github.com/gogits | |
parent | cd9b29ff3fe50396f3525bf03bce9f9f9556a2f6 (diff) |
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.
Diffstat (limited to 'vendor/github.com/gogits')
-rw-r--r-- | vendor/github.com/gogits/git-module/git.go | 2 | ||||
-rw-r--r-- | vendor/github.com/gogits/git-module/hook.go | 14 |
2 files changed, 11 insertions, 5 deletions
diff --git a/vendor/github.com/gogits/git-module/git.go b/vendor/github.com/gogits/git-module/git.go index eee4b1b5..fc834196 100644 --- a/vendor/github.com/gogits/git-module/git.go +++ b/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 diff --git a/vendor/github.com/gogits/git-module/hook.go b/vendor/github.com/gogits/git-module/hook.go index 6ba66be0..a0d0b16b 100644 --- a/vendor/github.com/gogits/git-module/hook.go +++ b/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 } |