#1089 change to fake local email account
This commit is contained in:
parent
caf7618ea6
commit
9c67a19332
1 changed files with 2 additions and 2 deletions
|
@ -104,8 +104,8 @@ func NewRepoContext() {
|
||||||
log.Fatal(4, "Gogs requires Git version greater or equal to 1.7.1")
|
log.Fatal(4, "Gogs requires Git version greater or equal to 1.7.1")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if server has user.email and user.name set correctly and set if they're not.
|
// Git requires setting user.name and user.email in order to commit changes.
|
||||||
for configKey, defaultValue := range map[string]string{"user.name": "Gogs", "user.email": "gogitservice@gmail.com"} {
|
for configKey, defaultValue := range map[string]string{"user.name": "Gogs", "user.email": "gogs@fake.local"} {
|
||||||
if stdout, stderr, err := process.Exec("NewRepoContext(get setting)", "git", "config", "--get", configKey); err != nil || strings.TrimSpace(stdout) == "" {
|
if stdout, stderr, err := process.Exec("NewRepoContext(get setting)", "git", "config", "--get", configKey); err != nil || strings.TrimSpace(stdout) == "" {
|
||||||
// ExitError indicates this config is not set
|
// ExitError indicates this config is not set
|
||||||
if _, ok := err.(*exec.ExitError); ok || strings.TrimSpace(stdout) == "" {
|
if _, ok := err.(*exec.ExitError); ok || strings.TrimSpace(stdout) == "" {
|
||||||
|
|
Loading…
Reference in a new issue