6
0
mirror of https://github.com/grdl/git-get.git synced 2026-02-10 01:29:19 +00:00

Refactor URL parsing so it's not being called twice

This commit is contained in:
Grzegorz Dlugoszewski
2020-05-22 15:53:44 +02:00
parent 2b622b99fe
commit a530b1506c
5 changed files with 52 additions and 44 deletions

View File

@@ -1,6 +1,7 @@
package pkg
import (
urlpkg "net/url"
"os"
"testing"
)
@@ -14,7 +15,9 @@ func TestFetch(t *testing.T) {
// Clone the origin repo
repoRoot := newTempDir(t)
path, err := CloneRepo(origin.Path(), repoRoot)
url, err := urlpkg.Parse(origin.Path())
checkFatal(t, err)
path, err := CloneRepo(url, repoRoot)
checkFatal(t, err)
// Open cloned repo and load its status