Skip to content

Error while running feth with just URL on repo without remotes #1723

@SergeyKalutsky

Description

@SergeyKalutsky

Hi)
I've got an error:

/Users/sergeykalutsky/lib/bridge/bridge/node_modules/isomorphic-git/index.cjs:1712
throw new NoRefspecError(remote)
^
NoRefspecError: Could not find a fetch refspec for remote "origin". Make sure the config file has an entry like the following:
[remote "origin"]
fetch = +refs/heads/:refs/remotes/origin/

at Function.updateRemoteRefs (/Users/sergeykalutsky/lib/bridge/bridge/node_modules/isomorphic-git/index.cjs:1712:15)
at async _fetch (/Users/sergeykalutsky/lib/bridge/bridge/node_modules/isomorphic-git/index.cjs:7588:24)
at async Object.fetch (/Users/sergeykalutsky/lib/bridge/bridge/node_modules/isomorphic-git/index.cjs:9273:12) {

caller: 'git.fetch',
code: 'NoRefspecError',
data: { remote: 'origin' }

while running fetch

const result = await git.fetch({
        fs,
        http,
        dir: dir,
        ref: 'master',
        url: 'https://github.com/SergeyKalutsky/test2303.git',
        tags: false
    })

The repo doesn't have any remotes. It throws an error. Not sure if I do not understand something and it is intended behavior or it is a bug. Thought I would let you know.

After adding remote origin error goes away.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions