aboutsummaryrefslogtreecommitdiff
path: root/pkg/rtree/index.go
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2017-07-07 12:14:06 +0200
committerStefan Majewsky <majewsky@gmx.net>2017-07-07 12:14:06 +0200
commit23077b75410d6fab51762236f195d92bd559fc6a (patch)
tree12ec00d832b3958d5194adeab4b73ff37aeeef4b /pkg/rtree/index.go
parent79933615f7988cb731baa0768a45b39008f18b20 (diff)
downloadgofu-23077b75410d6fab51762236f195d92bd559fc6a.tar.gz
many more `rtree get` tests
Diffstat (limited to 'pkg/rtree/index.go')
-rw-r--r--pkg/rtree/index.go3
1 files changed, 2 insertions, 1 deletions
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
}