From 1f0cca9cd2df5e294f4a891941c717c55c6fde57 Mon Sep 17 00:00:00 2001 From: Petar Maymounkov Date: Thu, 19 Oct 2023 10:01:12 -0700 Subject: [PATCH] fix usage of OS-paths vs Git-paths (#23) --- git/git.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/git/git.go b/git/git.go index d3c5509..0f256c1 100644 --- a/git/git.go +++ b/git/git.go @@ -3,7 +3,7 @@ package git import ( "context" "fmt" - "path/filepath" + "strings" "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" @@ -26,7 +26,7 @@ func (b Branch) ReferenceName() plumbing.ReferenceName { } func (b Branch) Sub(s string) Branch { - return Branch(filepath.Join(string(b), s)) + return Branch(strings.Join([]string{string(b), s}, "/")) } type CommitHash string @@ -50,7 +50,7 @@ func (a Address) Sub(s string) Address { } func (a Address) Join(s ns.NS) Address { - return Address{Repo: a.Repo, Branch: a.Branch.Sub(s.Path())} + return Address{Repo: a.Repo, Branch: a.Branch.Sub(s.GitPath())} } func (a Address) String() string {