mirror of
https://github.com/gogs/gogs.git
synced 2025-12-20 23:30:00 +01:00
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.
This commit is contained in:
14
vendor/github.com/gogits/git-module/hook.go
generated
vendored
14
vendor/github.com/gogits/git-module/hook.go
generated
vendored
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user