From 23077b75410d6fab51762236f195d92bd559fc6a Mon Sep 17 00:00:00 2001 From: Stefan Majewsky Date: Fri, 7 Jul 2017 12:14:06 +0200 Subject: many more `rtree get` tests --- pkg/rtree/index.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'pkg/rtree/index.go') diff --git a/pkg/rtree/index.go b/pkg/rtree/index.go index c7d6097..88e8b2d 100644 --- a/pkg/rtree/index.go +++ b/pkg/rtree/index.go @@ -92,6 +92,7 @@ func (r reposByAbsPath) Swap(i, j int) { r[i], r[j] = r[j], r[i] } //Write writes the index file to disk. func (i *Index) Write() error { + sort.Sort(reposByAbsPath(i.Repos)) buf, err := yaml.Marshal(i) if err != nil { return err @@ -304,7 +305,7 @@ func (i *Index) FindRepo(remoteURL string, allowClone bool) (*Repo, error) { //find the repo selected by the user var target *Repo for _, repo := range candidates { - if target.CheckoutPath == selection { + if repo.CheckoutPath == selection { target = repo break } -- cgit v1.3.1