forked from shibukawa/git4go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compat_unix.go
52 lines (44 loc) · 1.11 KB
/
compat_unix.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// +build dragonfly freebsd linux nacl netbsd openbsd solaris
package git4go
import (
"os"
"path/filepath"
)
func guessSystemFile() []string {
return []string{"/etc"}
}
func guessGlobalFile() []string {
return []string{os.Getenv("HOME")}
}
func guessXDGFile() []string {
env := os.Getenv("XDG_CONFIG_HOME")
if env != "" {
return []string{filepath.Join(env, "git")}
} else {
home := os.Getenv("HOME")
if home != "" {
return []string{filepath.Join(home, ".config/git")}
} else {
return []string{}
}
}
}
func guessTemplateFile() []string {
return []string{"/usr/share/git-core/templates"}
}
var defaultBoolConfig map[string]bool = map[string]bool{
"core.symlinks": true,
"core.ignorecase": false,
"core.filemode": true,
"core.ignorestat": false,
"core.trustctime": true,
"core.abbrev": true,
"core.precomposeunicode": true,
"core.logallrefupdates": true,
"core.protectHFS": false,
"core.protectNTFS": false,
}
var defaultStringConfig map[string]string = map[string]string{
"core.autocrlf": "false",
"core.eol": "crlf",
}