Merge pull request #387 from ahmedelgabri/master

Make sure editor is set properly & not overridden later
This commit is contained in:
Nate Smith 2020-02-13 13:14:41 -06:00 committed by GitHub
commit 65a7d05205
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,14 +25,11 @@ var (
func init() {
if runtime.GOOS == "windows" {
editor = "notepad"
}
if g := os.Getenv("GIT_EDITOR"); g != "" {
} else if g := os.Getenv("GIT_EDITOR"); g != "" {
editor = g
}
if v := os.Getenv("VISUAL"); v != "" {
} else if v := os.Getenv("VISUAL"); v != "" {
editor = v
}
if e := os.Getenv("EDITOR"); e != "" {
} else if e := os.Getenv("EDITOR"); e != "" {
editor = e
}
}