提交 0d1ddfe5 编写于 作者: M Mislav Marohnić

Merge pull request #946 from whilp/fix-test-git-editor

Fix spurious test failure when GIT_EDITOR is set
package git
import (
"os"
"strings"
"testing"
......@@ -18,7 +19,16 @@ func TestGitDir(t *testing.T) {
func TestGitEditor(t *testing.T) {
repo := fixtures.SetupTestRepo()
defer repo.TearDown()
editor := os.Getenv("GIT_EDITOR")
if err := os.Unsetenv("GIT_EDITOR"); err != nil {
t.Fatal(err)
}
defer func() {
repo.TearDown()
if err := os.Setenv("GIT_EDITOR", editor); err != nil {
t.Fatal(err)
}
}()
SetGlobalConfig("core.editor", "foo")
gitEditor, err := Editor()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册