fix: handle submodule which has no url or path

This commit is contained in:
EnixCoda 2019-03-14 17:15:41 +08:00
parent 2dd62ed821
commit cee198e036
No known key found for this signature in database
GPG key ID: 0C1A07377913A1DD

View file

@ -86,8 +86,8 @@ type Parsed = {
}
type ParsedModule = {
path: string
url: string
path?: string
url?: string
}
function resolveGitModules(root: TreeNode, blobData: BlobData) {
@ -102,6 +102,7 @@ function resolveGitModules(root: TreeNode, blobData: BlobData) {
function handleParsed(root: TreeNode, parsed: Parsed) {
Object.values(parsed).forEach(value => {
if (typeof value === 'string') return
const { url, path } = value
if (typeof url === 'string' && typeof path === 'string') {
const node = findNode(root, path.split('/'))