aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorFilip Navara <navara@emclient.com>2018-10-05 10:15:15 +0200
committerFilip Navara <navara@emclient.com>2018-10-05 10:15:15 +0200
commitc2ba07bbd7dea849049184a888d67b016a20b6ae (patch)
treef0a2e122b71dd0ade593208ad2e9e0c8a6a2da8e /config
parentc2ab4ac47d87f4cd674d19228e24b6696bd1db4d (diff)
downloadgo-git-c2ba07bbd7dea849049184a888d67b016a20b6ae.tar.gz
Add test for Windows local paths.
Signed-off-by: Filip Navara <navara@emclient.com>
Diffstat (limited to 'config')
-rw-r--r--config/config_test.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/config/config_test.go b/config/config_test.go
index fe73de8..db0932c 100644
--- a/config/config_test.go
+++ b/config/config_test.go
@@ -24,6 +24,8 @@ func (s *ConfigSuite) TestUnmarshall(c *C) {
url = git@github.com:src-d/go-git.git
fetch = +refs/heads/*:refs/remotes/origin/*
fetch = +refs/pull/*:refs/remotes/origin/pull/*
+[remote "win-local"]
+ url = X:\\Git\\
[submodule "qux"]
path = qux
url = https://github.com/foo/qux.git
@@ -41,13 +43,15 @@ func (s *ConfigSuite) TestUnmarshall(c *C) {
c.Assert(cfg.Core.Worktree, Equals, "foo")
c.Assert(cfg.Core.CommentChar, Equals, "bar")
c.Assert(cfg.Pack.Window, Equals, uint(20))
- c.Assert(cfg.Remotes, HasLen, 2)
+ c.Assert(cfg.Remotes, HasLen, 3)
c.Assert(cfg.Remotes["origin"].Name, Equals, "origin")
c.Assert(cfg.Remotes["origin"].URLs, DeepEquals, []string{"git@github.com:mcuadros/go-git.git"})
c.Assert(cfg.Remotes["origin"].Fetch, DeepEquals, []RefSpec{"+refs/heads/*:refs/remotes/origin/*"})
c.Assert(cfg.Remotes["alt"].Name, Equals, "alt")
c.Assert(cfg.Remotes["alt"].URLs, DeepEquals, []string{"git@github.com:mcuadros/go-git.git", "git@github.com:src-d/go-git.git"})
c.Assert(cfg.Remotes["alt"].Fetch, DeepEquals, []RefSpec{"+refs/heads/*:refs/remotes/origin/*", "+refs/pull/*:refs/remotes/origin/pull/*"})
+ c.Assert(cfg.Remotes["win-local"].Name, Equals, "win-local")
+ c.Assert(cfg.Remotes["win-local"].URLs, DeepEquals, []string{"X:\\Git\\"})
c.Assert(cfg.Submodules, HasLen, 1)
c.Assert(cfg.Submodules["qux"].Name, Equals, "qux")
c.Assert(cfg.Submodules["qux"].URL, Equals, "https://github.com/foo/qux.git")
@@ -69,6 +73,8 @@ func (s *ConfigSuite) TestMarshall(c *C) {
fetch = +refs/pull/*:refs/remotes/origin/pull/*
[remote "origin"]
url = git@github.com:mcuadros/go-git.git
+[remote "win-local"]
+ url = "X:\\Git\\"
[submodule "qux"]
url = https://github.com/foo/qux.git
[branch "master"]
@@ -91,6 +97,11 @@ func (s *ConfigSuite) TestMarshall(c *C) {
Fetch: []RefSpec{"+refs/heads/*:refs/remotes/origin/*", "+refs/pull/*:refs/remotes/origin/pull/*"},
}
+ cfg.Remotes["win-local"] = &RemoteConfig{
+ Name: "win-local",
+ URLs: []string{"X:\\Git\\"},
+ }
+
cfg.Submodules["qux"] = &Submodule{
Name: "qux",
URL: "https://github.com/foo/qux.git",
@@ -119,6 +130,8 @@ func (s *ConfigSuite) TestUnmarshallMarshall(c *C) {
url = git@github.com:mcuadros/go-git.git
fetch = +refs/heads/*:refs/remotes/origin/*
mirror = true
+[remote "win-local"]
+ url = "X:\\Git\\"
[branch "master"]
remote = origin
merge = refs/heads/master