Allow adding new files to an empty repo (#24164)

This commit is contained in:
@ -27,7 +27,7 @@ import (
|
||||
var (
|
||||
// AppVer is the version of the current build of Gitea. It is set in main.go from main.Version.
|
||||
AppVer string
|
||||
// AppBuiltWith represents a human readable version go runtime build version and build tags. (See main.go formatBuiltWith().)
|
||||
// AppBuiltWith represents a human-readable version go runtime build version and build tags. (See main.go formatBuiltWith().)
|
||||
AppBuiltWith string
|
||||
// AppStartTime store time gitea has started
|
||||
AppStartTime time.Time
|
||||
@ -40,7 +40,8 @@ var (
|
||||
// AppWorkPath is used as the base path for several other paths.
|
||||
AppWorkPath string
|
||||
|
||||
// Global setting objects
|
||||
// Other global setting objects
|
||||
|
||||
CfgProvider ConfigProvider
|
||||
CustomPath string // Custom directory path
|
||||
CustomConf string
|
||||
@ -48,6 +49,10 @@ var (
|
||||
RunUser string
|
||||
IsProd bool
|
||||
IsWindows bool
|
||||
|
||||
// IsInTesting indicates whether the testing is running. A lot of unreliable code causes a lot of nonsense error logs during testing
|
||||
// TODO: this is only a temporary solution, we should make the test code more reliable
|
||||
IsInTesting = false
|
||||
)
|
||||
|
||||
func getAppPath() (string, error) {
|
||||
@ -108,8 +113,12 @@ func getWorkPath(appPath string) string {
|
||||
|
||||
func init() {
|
||||
IsWindows = runtime.GOOS == "windows"
|
||||
if AppVer == "" {
|
||||
AppVer = "dev"
|
||||
}
|
||||
|
||||
// We can rely on log.CanColorStdout being set properly because modules/log/console_windows.go comes before modules/setting/setting.go lexicographically
|
||||
// By default set this logger at Info - we'll change it later but we need to start with something.
|
||||
// By default set this logger at Info - we'll change it later, but we need to start with something.
|
||||
log.NewLogger(0, "console", "console", fmt.Sprintf(`{"level": "info", "colorize": %t, "stacktraceLevel": "none"}`, log.CanColorStdout))
|
||||
|
||||
var err error
|
||||
|
Reference in New Issue
Block a user