diff options
| author | Stefan Majewsky <majewsky@gmx.net> | 2026-06-10 00:07:56 +0200 |
|---|---|---|
| committer | Stefan Majewsky <majewsky@gmx.net> | 2026-06-10 00:07:56 +0200 |
| commit | daeb9127764fc9dd469294f755e277fdfca09a00 (patch) | |
| tree | ec5cd2b83e5f097527eaea985790e7ac49fa95cb /internal/rtree/get_test.go | |
| parent | 6903a774ecbbd05596adda5e2b5e18d58dd3a8f9 (diff) | |
| download | gofu-daeb9127764fc9dd469294f755e277fdfca09a00.tar.gz | |
rtree: add support for multiple URLs per remote
This requires changing the index format, which I'm using as an
opportunity to:
- move from YAML to JSON (so I can maybe kill the YAML parser dependency
at some point)
- move the index file into standard XDG paths
Diffstat (limited to 'internal/rtree/get_test.go')
| -rw-r--r-- | internal/rtree/get_test.go | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/internal/rtree/get_test.go b/internal/rtree/get_test.go index 4d0d8f3..222ad99 100644 --- a/internal/rtree/get_test.go +++ b/internal/rtree/get_test.go @@ -13,14 +13,14 @@ var testIndexWithTwoRepos = Index{ Repos: []*Repo{ { CheckoutPath: "github.com/foo/bar", - Remotes: []Remote{ - {Name: "origin", URL: "https://github.com/foo/bar"}, + Remotes: map[string]Remote{ + "origin": {URLs: []RemoteURL{"https://github.com/foo/bar"}}, }, }, { CheckoutPath: "github.com/git/git", - Remotes: []Remote{ - {Name: "origin", URL: "https://github.com/git/git"}, + Remotes: map[string]Remote{ + "origin": {URLs: []RemoteURL{"https://github.com/git/git"}}, }, }, }, @@ -55,9 +55,9 @@ func TestGetNewRepo(t *testing.T) { Repos: []*Repo{ { CheckoutPath: "github.com/another/repo", - Remotes: []Remote{ + Remotes: map[string]Remote{ //regardless of the remote URL used, we expect the contracted form to be used - {Name: "origin", URL: "https://github.com/another/repo"}, + "origin": {URLs: []RemoteURL{"https://github.com/another/repo"}}, }, }, testIndexWithTwoRepos.Repos[0], @@ -90,9 +90,9 @@ func TestGetNewForkAsRemote(t *testing.T) { testIndexWithTwoRepos.Repos[0], { CheckoutPath: "github.com/git/git", - Remotes: []Remote{ - {Name: "origin", URL: "https://github.com/git/git"}, - {Name: "myfork", URL: "https://example.com/git"}, + Remotes: map[string]Remote{ + "origin": {URLs: []RemoteURL{"https://github.com/git/git"}}, + "myfork": {URLs: []RemoteURL{"https://example.com/git"}}, }, }, }, @@ -116,8 +116,8 @@ func TestGetNewForkAsSeparate(t *testing.T) { Repos: []*Repo{ { CheckoutPath: "example.com/git", - Remotes: []Remote{ - {Name: "origin", URL: "https://example.com/git"}, + Remotes: map[string]Remote{ + "origin": {URLs: []RemoteURL{"https://example.com/git"}}, }, }, testIndexWithTwoRepos.Repos[0], |
