Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: git failure when branch and filename collide #190

Open
kochie opened this issue Aug 2, 2022 · 3 comments · May be fixed by #191
Open

bug: git failure when branch and filename collide #190

kochie opened this issue Aug 2, 2022 · 3 comments · May be fixed by #191

Comments

@kochie
Copy link

kochie commented Aug 2, 2022

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

release/bin/release.js

Lines 316 to 323 in 5b434c9

try {
const unordered = await getTags({
previousTag: flags.previousTag
});
tags = unordered.sort((a, b) => new Date(b.date) - new Date(a.date));
} catch (err) {
fail('Directory is not a Git repository.');
}

@kochie
Copy link
Author

kochie commented Aug 2, 2022

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

@kochie kochie linked a pull request Aug 2, 2022 that will close this issue
@nagaozen
Copy link

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

image

@nagaozen
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants