diff --git a/internal/git/git_test.go b/internal/git/git_test.go index e435eb6..e6e8278 100644 --- a/internal/git/git_test.go +++ b/internal/git/git_test.go @@ -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") } diff --git a/pkg/rpc/file/search.go b/pkg/rpc/file/search.go index 2dd815f..a6db8bd 100644 --- a/pkg/rpc/file/search.go +++ b/pkg/rpc/file/search.go @@ -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. diff --git a/pkg/rpc/repo/search.go b/pkg/rpc/repo/search.go index d4d67bd..633ad23 100644 --- a/pkg/rpc/repo/search.go +++ b/pkg/rpc/repo/search.go @@ -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.