From 1479f20c3e696a78dafc7a04b24f1c11f036c9d0 Mon Sep 17 00:00:00 2001 From: Tomohiro Nishimura Date: Wed, 4 Jun 2014 12:33:53 +0900 Subject: [PATCH] Fix never use default local repository root issue --- git.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/git.go b/git.go index e9f8bef..eecb5a5 100644 --- a/git.go +++ b/git.go @@ -17,7 +17,12 @@ func GitConfigAll(key string) ([]string, error) { return nil, err } - return strings.Split(value, "\000"), nil + var values = strings.Split(value, "\000") + if len(values) == 1 && values[0] == "" { + values = values[:0] + } + + return values, nil } func gitConfig(key string, all bool) (string, error) {