Skip to content

Commit

Permalink
fix usage of OS-paths vs Git-paths (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
petar authored Oct 19, 2023
1 parent ce515c9 commit 1f0cca9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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 {
Expand Down

0 comments on commit 1f0cca9

Please sign in to comment.