indo icon indicating copy to clipboard operation
indo copied to clipboard

`indo` fails when trying to add a local repo to "repos" without an origin

Open aleclarson opened this issue 5 years ago • 2 comments

Steps to reproduce

  1. Create a sub-directory in a project that uses indo
  2. Run git init in that sub-directory
  3. Run indo and select "Add to repos"
  4. Witness a grotesque crash like this:
error: Error: fatal: No such remote 'origin'
    at exec (~/indo/node_modules/.pnpm/registry.npmjs.org/@cush/exec/1.6.2/node_modules/@cush/exec/index.js:88:21)
    at Function.execSync [as sync] (~/indo/node_modules/.pnpm/registry.npmjs.org/@cush/exec/1.6.2/node_modules/@cush/exec/index.js:11:10)
    at Object.getRemoteUrl (~/indo/dist/core/git.js:15:31)
    at findUnknownRepos (~/indo/dist/commands/default.js:75:36)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Object.exports.default (~/indo/dist/commands/default.js:24:5) {
  exitCode: 128
}

aleclarson avatar Aug 10 '20 14:08 aleclarson

To fix this, we should prompt the user for an origin (and offer to create a new repo if hub command exists).

aleclarson avatar Apr 12 '21 16:04 aleclarson

It also fails if no initial commit exists yet

aleclarson avatar Jun 06 '21 01:06 aleclarson