From 2d9dd254938fc7d3741243bd46ad41b9c6941ab9 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 1 Feb 2015 20:17:56 +0100 Subject: [PATCH] config/module: fix regression of ignoring forced type if valid URL /cc @ceh - Does this break Windows at all? This regressed with your commit (we didn't have test coverage on it). I added a test now, though. --- config/module/detect.go | 2 +- config/module/detect_test.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/config/module/detect.go b/config/module/detect.go index f70e69a47..9a56bf82d 100644 --- a/config/module/detect.go +++ b/config/module/detect.go @@ -41,7 +41,7 @@ func Detect(src string, pwd string) (string, error) { u, err := urlParse(getSrc) if err == nil && u.Scheme != "" { // Valid URL - return u.String(), nil + return src, nil } for _, d := range Detectors { diff --git a/config/module/detect_test.go b/config/module/detect_test.go index 69a5a6fef..a81bba12b 100644 --- a/config/module/detect_test.go +++ b/config/module/detect_test.go @@ -31,6 +31,12 @@ func TestDetect(t *testing.T) { "git::https://github.com/hashicorp/foo.git//bar", false, }, + { + "git::https://github.com/hashicorp/consul.git", + "", + "git::https://github.com/hashicorp/consul.git", + false, + }, } for i, tc := range cases {