release icon indicating copy to clipboard operation
release copied to clipboard

bug: git failure when branch and filename collide

Open kochie opened this issue 3 years ago • 3 comments

I assume this is related to #186

When you have a file/directory with the same name as the branch you get an error.

ChildProcessError: Command failed: git log --simplify-by-decoration --pretty="%d;%H;%ci" --decorate=short HEAD --first-parent `git rev-parse --abbrev-ref HEAD`
fatal: ambiguous argument 'main': both revision and filename
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
ChildProcessError: Command failed: git log --simplify-by-decoration --pretty="%d;%H;%ci" --decorate=short HEAD --first-parent `git rev-parse --abbrev-ref HEAD`
fatal: ambiguous argument 'main': both revision and filename
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
 `git log --simplify-by-decoration --pretty="%d;%H;%ci" --decorate=short HEAD --first-parent `git rev-parse --abbrev-ref HEAD`` (exited with error code 128)
    at callback (/Users/robekoc/projects/personal/release/node_modules/child-process-promise/lib/index.js:33:27)
    at ChildProcess.exithandler (node:child_process:395:5)
    at ChildProcess.emit (node:events:527:28)
    at maybeClose (node:internal/child_process:1090:16)
    at Socket.<anonymous> (node:internal/child_process:449:11)
    at Socket.emit (node:events:527:28)
    at Pipe.<anonymous> (node:net:715:12) {
  code: 128,
  childProcess: {
    _forkChild: [Function: _forkChild],
    ChildProcess: [Function: ChildProcess],
    exec: [Function: exec],
    execFile: [Function: execFile],
    execFileSync: [Function: execFileSync],
    execSync: [Function: execSync],
    fork: [Function: fork],
    spawn: [Function: spawn],
    spawnSync: [Function: spawnSync]
  },
  stdout: '',
  stderr: "fatal: ambiguous argument 'main': both revision and filename\n" +
    "Use '--' to separate paths from revisions, like this:\n" +
    "'git <command> [<revision>...] -- [<file>...]'\n"
}
Error! Directory is not a Git repository.

Failing in https://github.com/vercel/release/blob/5b434c96e8809b2c9b287ea17124887e260d8aab/bin/release.js#L316-L323

kochie avatar Aug 02 '22 09:08 kochie

In my case because I'm building an electron app I have a directory called main

kochie avatar Aug 02 '22 09:08 kochie

In my case, I don't have neither a directory nor a file named master, but still facing this issue ...

image

nagaozen avatar Apr 10 '24 14:04 nagaozen

In my case, this error is related to #129.

nagaozen avatar Apr 10 '24 15:04 nagaozen