Skip to content

Commit

Permalink
Use empty dir when importing git submodules.
Browse files Browse the repository at this point in the history
  • Loading branch information
nasdf committed Feb 3, 2021
1 parent 8868cf5 commit dbaf42e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package git

import (
"context"
"errors"
"io/ioutil"
"path"
"path/filepath"
Expand All @@ -16,6 +15,7 @@ import (
"github.com/ipfs/go-cid"
ipld "github.com/ipfs/go-ipld-format"
"github.com/ipfs/go-merkledag"
ufs "github.com/ipfs/go-unixfs"
ufsio "github.com/ipfs/go-unixfs/io"
"github.com/multiverse-vcs/go-multiverse/data"
"github.com/multiverse-vcs/go-multiverse/unixfs"
Expand Down Expand Up @@ -217,7 +217,7 @@ func (i *importer) AddTreeEntry(entry object.TreeEntry) (ipld.Node, error) {
case filemode.Dir:
return i.AddTree(entry.Hash)
case filemode.Submodule:
return nil, errors.New("submodules not supported")
return ufs.EmptyDirNode(), nil
}

blob, err := i.repo.BlobObject(entry.Hash)
Expand Down
4 changes: 2 additions & 2 deletions git/git_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestImportFromFS(t *testing.T) {
defer os.RemoveAll(dir)

opts := git.CloneOptions{
URL: "https://github.com/multiverse-vcs/go-multiverse",
URL: "https://github.com/hsoft/collapseos",
}

_, err = git.PlainClone(dir, false, &opts)
Expand All @@ -62,4 +62,4 @@ func TestImportFromFS(t *testing.T) {
if repo.Name != "test" {
t.Error("unexpected repo name")
}
}
}

0 comments on commit dbaf42e

Please sign in to comment.