![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true) | ![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true) | ||||
##### Current tip version: 0.9.89 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions) | |||||
##### Current tip version: 0.9.90 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions) | |||||
| Web | UI | Preview | | | Web | UI | Preview | | ||||
|:-------------:|:-------:|:-------:| | |:-------------:|:-------:|:-------:| |
MAX_CREATION_LIMIT = -1 | MAX_CREATION_LIMIT = -1 | ||||
; Patch test queue length, make it as large as possible | ; Patch test queue length, make it as large as possible | ||||
PULL_REQUEST_QUEUE_LENGTH = 10000 | PULL_REQUEST_QUEUE_LENGTH = 10000 | ||||
; Preferred Licenses to place at the top of the List | |||||
; Name must match file name in conf/license or custom/conf/license | |||||
PREFERRED_LICENSES = Apache License 2.0,MIT License | |||||
[repository.editor] | [repository.editor] | ||||
; List of file extensions that should have line wraps in the CodeMirror editor | ; List of file extensions that should have line wraps in the CodeMirror editor |
"github.com/gogits/gogs/modules/setting" | "github.com/gogits/gogs/modules/setting" | ||||
) | ) | ||||
const APP_VER = "0.9.89.0827" | |||||
const APP_VER = "0.9.90.0828" | |||||
func init() { | func init() { | ||||
runtime.GOMAXPROCS(runtime.NumCPU()) | runtime.GOMAXPROCS(runtime.NumCPU()) |
func LoadRepoConfig() { | func LoadRepoConfig() { | ||||
// Load .gitignore and license files and readme templates. | // Load .gitignore and license files and readme templates. | ||||
// TODO: should we allow custom files overwrite default ones? | |||||
types := []string{"gitignore", "license", "readme"} | types := []string{"gitignore", "license", "readme"} | ||||
typeFiles := make([][]string, 3) | typeFiles := make([][]string, 3) | ||||
for i, t := range types { | for i, t := range types { | ||||
sort.Strings(Gitignores) | sort.Strings(Gitignores) | ||||
sort.Strings(Licenses) | sort.Strings(Licenses) | ||||
sort.Strings(Readmes) | sort.Strings(Readmes) | ||||
// Filter out invalid names and promote preferred licenses. | |||||
sortedLicenses := make([]string, 0, len(Licenses)) | |||||
for _, name := range setting.Repository.PreferredLicenses { | |||||
if com.IsSliceContainsStr(Licenses, name) { | |||||
sortedLicenses = append(sortedLicenses, name) | |||||
} | |||||
} | |||||
for _, name := range Licenses { | |||||
if !com.IsSliceContainsStr(setting.Repository.PreferredLicenses, name) { | |||||
sortedLicenses = append(sortedLicenses, name) | |||||
} | |||||
} | |||||
Licenses = sortedLicenses | |||||
} | } | ||||
func NewRepoContext() { | func NewRepoContext() { |
ForcePrivate bool | ForcePrivate bool | ||||
MaxCreationLimit int | MaxCreationLimit int | ||||
PullRequestQueueLength int | PullRequestQueueLength int | ||||
PreferredLicenses []string | |||||
// Repository editor settings | // Repository editor settings | ||||
Editor struct { | Editor struct { |
0.9.89.0827 | |||||
0.9.90.0828 |