aboutsummaryrefslogtreecommitdiff
path: root/internal/service/git.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/service/git.go')
-rw-r--r--internal/service/git.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/internal/service/git.go b/internal/service/git.go
index ad3a653..b61e332 100644
--- a/internal/service/git.go
+++ b/internal/service/git.go
@@ -3,11 +3,12 @@ package service
import (
"errors"
"fmt"
- "net/url"
"os"
"os/exec"
"path"
"strings"
+
+ "git.server.ky/slackcoder/mirror/internal"
)
const gitDescriptionFile = "description"
@@ -44,7 +45,7 @@ func setDescription(repo string, desc string) error {
}
// Set the remote origin's URL for the projects repository.
-func setRemoteOrigin(repo string, origin *url.URL) error {
+func setRemoteOrigin(repo string, origin *internal.URL) error {
cmd := exec.Command("git", "remote", "get-url", "origin")
cmd.Dir = repo
buf, err := cmd.Output()
@@ -87,7 +88,7 @@ func getRemoteHeadReference(repo string) (string, error) {
return "", errors.New("not found")
}
-func MirrorGit(dst *url.URL, src *url.URL, description string) error {
+func MirrorGit(dst *internal.URL, src *internal.URL, description string) error {
if dst.Scheme != "" && dst.Scheme != "file://" {
return fmt.Errorf("'%s' scheme not supported", dst.Scheme)
}