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] Error: Unable to locate the previous sha: fatal: ambiguous argument 'main': unknown revision or path not in the working tree #840

Closed
3 tasks done
valberg opened this issue Dec 7, 2022 · 2 comments · Fixed by #843
Labels
bug Something isn't working

Comments

@valberg
Copy link

valberg commented Dec 7, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Does this issue exist in the latest version?

  • I'm using the latest release

Describe the bug?

Since today I'm getting the following error:

Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'
Error: Unable to locate the previous sha: fatal: ambiguous argument 'main': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'
Error: Please verify that the previous sha commit is valid, and increase the fetch_depth to a number higher than 40.
Error: Process completed with exit code 1.

I have tried setting the fetch-depth to 42 (higher than 40), with the same results.

I guess it has something to do with version 34.5.1 released yesterday.

To Reproduce

Run changed-files with the latest version.

What OS are you seeing the problem on?

ubuntu-latest or ubuntu-20.04

Expected behavior?

I would expect it not to fail.

Relevant log output

The log is too long for this input field so I have created a gist for it: https://gist.github.com/valberg/e2c48ae6dcee3794c33e70fd0857610a

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@valberg valberg added the bug Something isn't working label Dec 7, 2022
@jackton1 jackton1 linked a pull request Dec 10, 2022 that will close this issue
@jackton1
Copy link
Member

jackton1 commented Dec 10, 2022

@valberg This should resolved in the latest release.

@emesar
Copy link

emesar commented Feb 7, 2023

I think this bug has recurred - potentially as a result of a git pull origin main on the target branch:

  Verifying git version...
  Valid git version found: (2.39.1)
  Running on a pull request event...
  fatal: ambiguous argument 'origin/main': unknown revision or path not in the working tree.
  Use '--' to separate paths from revisions, like this:
  'git <command> [<revision>...] -- [<file>...]'
  Error: Unable to locate the previous sha: origin/main
  Error: Please verify that the previous sha is valid, and increase the fetch_depth to a number higher than 50.
  Error: Process completed with exit code 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants