You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package setting
  5. import (
  6. "time"
  7. "code.gitea.io/gitea/modules/log"
  8. )
  9. var (
  10. // Git settings
  11. Git = struct {
  12. Path string
  13. DisableDiffHighlight bool
  14. MaxGitDiffLines int
  15. MaxGitDiffLineCharacters int
  16. MaxGitDiffFiles int
  17. CommitsRangeSize int // CommitsRangeSize the default commits range size
  18. BranchesRangeSize int // BranchesRangeSize the default branches range size
  19. VerbosePush bool
  20. VerbosePushDelay time.Duration
  21. GCArgs []string `ini:"GC_ARGS" delim:" "`
  22. EnableAutoGitWireProtocol bool
  23. PullRequestPushMessage bool
  24. Timeout struct {
  25. Default int
  26. Migrate int
  27. Mirror int
  28. Clone int
  29. Pull int
  30. GC int `ini:"GC"`
  31. } `ini:"git.timeout"`
  32. }{
  33. DisableDiffHighlight: false,
  34. MaxGitDiffLines: 1000,
  35. MaxGitDiffLineCharacters: 5000,
  36. MaxGitDiffFiles: 100,
  37. CommitsRangeSize: 50,
  38. BranchesRangeSize: 20,
  39. VerbosePush: true,
  40. VerbosePushDelay: 5 * time.Second,
  41. GCArgs: []string{},
  42. EnableAutoGitWireProtocol: true,
  43. PullRequestPushMessage: true,
  44. Timeout: struct {
  45. Default int
  46. Migrate int
  47. Mirror int
  48. Clone int
  49. Pull int
  50. GC int `ini:"GC"`
  51. }{
  52. Default: 360,
  53. Migrate: 600,
  54. Mirror: 300,
  55. Clone: 300,
  56. Pull: 300,
  57. GC: 60,
  58. },
  59. }
  60. )
  61. func newGit() {
  62. if err := Cfg.Section("git").MapTo(&Git); err != nil {
  63. log.Fatal("Failed to map Git settings: %v", err)
  64. }
  65. }