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

fix: ensure git.hasDiff will not compare against files #23376

Merged
merged 3 commits into from
Jul 15, 2023

Conversation

felipecrs
Copy link
Contributor

Changes

This fixes a situation in which git.hasDiff may try to compare against a remote branch but there is a file with the same name. The fix resolves such ambiguity, so that git will always treat the argument as a revision spec and not a potential file.

Context

❯ git diff HEAD origin/master
[works]
❯ mkdir -p origin && touch origin/master
❯ git diff HEAD origin/master
fatal: ambiguous argument 'origin/master': both revision and filename
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
> git diff HEAD origin/master --
[works]

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@CLAassistant
Copy link

CLAassistant commented Jul 14, 2023

CLA assistant check
All committers have signed the CLA.

rarkins
rarkins previously approved these changes Jul 14, 2023
Copy link
Member

@viceice viceice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs lint fix

@felipecrs
Copy link
Contributor Author

Ops, my bad!

@JamieMagee
Copy link
Contributor

This must have been a painful bug to find 😅

JamieMagee
JamieMagee previously approved these changes Jul 14, 2023
@felipecrs felipecrs dismissed stale reviews from JamieMagee and rarkins via 23f88e1 July 14, 2023 21:14
@felipecrs
Copy link
Contributor Author

Prettier fixed!

@felipecrs
Copy link
Contributor Author

The failure seems unrelated this time.

@JamieMagee JamieMagee added this pull request to the merge queue Jul 15, 2023
Merged via the queue into renovatebot:main with commit f529147 Jul 15, 2023
36 checks passed
@renovate-release
Copy link
Collaborator

🎉 This PR is included in version 36.8.11 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants