aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/transport/file/client_test.go
diff options
context:
space:
mode:
authorSantiago M. Mola <santi@mola.io>2017-04-28 15:20:51 +0200
committerSantiago M. Mola <santi@mola.io>2017-04-28 16:33:31 +0200
commit4a670e130804d630fa056e4a60101698dc7a9af1 (patch)
tree289fed4a798d9e3c7bdc633970109d8a7a856737 /plumbing/transport/file/client_test.go
parent727bf94da8e3cebd3ff467d30425b12d671fbca7 (diff)
downloadgo-git-4a670e130804d630fa056e4a60101698dc7a9af1.tar.gz
do not convert local paths to URL
* Do not convert local paths to URLs, just keep them as they are. * This way we add support for Windows without taking care of Windows path-to-URL conversion.
Diffstat (limited to 'plumbing/transport/file/client_test.go')
-rw-r--r--plumbing/transport/file/client_test.go7
1 files changed, 3 insertions, 4 deletions
diff --git a/plumbing/transport/file/client_test.go b/plumbing/transport/file/client_test.go
index 220df3d..030175e 100644
--- a/plumbing/transport/file/client_test.go
+++ b/plumbing/transport/file/client_test.go
@@ -1,9 +1,9 @@
package file
import (
- "fmt"
"io"
"os"
+ "path/filepath"
"strings"
"testing"
@@ -20,13 +20,12 @@ filemode = true
bare = true`
func prepareRepo(c *C, path string) transport.Endpoint {
- url := fmt.Sprintf("file://%s", path)
- ep, err := transport.NewEndpoint(url)
+ ep, err := transport.NewEndpoint(path)
c.Assert(err, IsNil)
// git-receive-pack refuses to update refs/heads/master on non-bare repo
// so we ensure bare repo config.
- config := fmt.Sprintf("%s/config", path)
+ config := filepath.Join(path, "config")
if _, err := os.Stat(config); err == nil {
f, err := os.OpenFile(config, os.O_TRUNC|os.O_WRONLY, 0)
c.Assert(err, IsNil)