Skip to content
Permalink
Browse files

Fix git server ns listing

  • Loading branch information...
tsileo committed Sep 16, 2019
1 parent e776620 commit 0189eb07a8febf34b4847a0f27ac305c28fbf615
Showing with 3 additions and 4 deletions.
  1. +2 −2 pkg/gitserver/gitserver.go
  2. +1 −1 pkg/kvstore/kvstore.go
  3. +0 −1 pkg/rangedb/rangedb.go
@@ -495,12 +495,12 @@ func (gs *GitServer) Namespaces() ([]string, error) {
if err != nil {
return nil, err
}
if len(keys) == 0 || !strings.HasPrefix(keys[0].Key, prefix) {
if len(keys) == 0 || !strings.HasPrefix(keys[0].Key, "_git:") {
break
}
dat := strings.Split(strings.Split(keys[0].Key, "!")[0], ":")
namespaces = append(namespaces, dat[1])
prefix = vkv.NextKey(fmt.Sprintf("_git:%s:", dat[1]))
prefix = vkv.NextKey(fmt.Sprintf("_git:%s", dat[1]))
}

return namespaces, nil
@@ -89,7 +89,7 @@ func (kv *KvStore) Get(ctx context.Context, key string, version int64) (*vkv.Key
}

func (kv *KvStore) Keys(ctx context.Context, start, end string, limit int) ([]*vkv.KeyValue, string, error) {
kv.log.Info("OP Keys", "start", "", "end", end)
kv.log.Info("OP Keys", "start", start, "end", end)
kvs, cursor, err := kv.vkv.Keys(start, end, limit)
return kvs, cursor, err
}
@@ -126,7 +126,6 @@ func (r *Range) Next() ([]byte, []byte, error) {
if r.it.Next() {
return buildKv(r.it)
}

} else {
if r.first {
if r.it.Last() {

0 comments on commit 0189eb0

Please sign in to comment.
You can’t perform that action at this time.