Skip to content

Commit

Permalink
add missing json fields
Browse files Browse the repository at this point in the history
  • Loading branch information
nasdf committed Mar 4, 2021
1 parent 5f6adf2 commit 27a56b7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
10 changes: 8 additions & 2 deletions internal/git/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@ package git
import (
"context"
"testing"
"path/filepath"

"github.com/ipfs/go-merkledag/dagutils"
)

func TestImportFromURL(t *testing.T) {
ctx := context.Background()
dag := dagutils.NewMemoryDagService()
mem := dagutils.NewMemoryDagService()

_, err := ImportFromURL(ctx, dag, "test", "https://github.com/multiverse-vcs/go-multiverse")
path, err := filepath.Abs("./../../")
if err != nil {
t.Fatal("failed to get absolute path")
}

_, err = ImportFromFS(ctx, mem, "test", path)
if err != nil {
t.Fatal("failed to import git repo")
}
Expand Down
12 changes: 6 additions & 6 deletions pkg/rpc/file/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ import (
// SearchArgs contains the args.
type SearchArgs struct {
// Remote is the remote path.
Remote string
Remote string `json:"remote"`
// Branch is the branch name.
Branch string
Branch string `json:"branch"`
// Path is the file path.
Path string
Path string `json:"path"`
}

// SearchReply contains the reply.
type SearchReply struct {
// Content contains file content.
Content string
Content string `json:"content"`
// Entries contains directory entries.
Entries []*fs.DirEntry
Entries []*fs.DirEntry `json:"entries"`
// IsDir specifies if the file is a directory.
IsDir bool
IsDir bool `json:"is_dir"`
}

// Search returns the contents of a file at the given remote path.
Expand Down
4 changes: 2 additions & 2 deletions pkg/rpc/repo/search.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import (
// SearchArgs contains the args.
type SearchArgs struct {
// Remote is the remote path.
Remote string
Remote string `json"remote"`
}

// SearchReply contains the reply.
type SearchReply struct {
Repository *object.Repository
Repository *object.Repository `json:"repository"`
}

// Search returns the repository at the given remote path.
Expand Down

0 comments on commit 27a56b7

Please sign in to comment.