I used git diff origin often in the past.
In a different environment it does not work. I have no clue why.
user@host> git diff origin
For those experiencing this error on CI/CD, adding the line below worked for me on my GitHub Actions CI/CD workflow right after running pip install pyflakes diff-cover:
git fetch origin master:refs/remotes/origin/master
This is a snippet of the solution from the diff-cover github repo:
Solution: diff-cover matches source files in the coverage XML report with source files in the git diff. For this reason, it's important that the relative paths to the files match. If you are using coverage.py to generate the coverage XML report, then make sure you run diff-cover from the same working directory.
I got the solution on the links below. It is a documented diff-cover error.
https://diff-cover.readthedocs.io/en/latest//README.html https://github.com/Bachmann1234/diff_cover/blob/master/README.rst
Hope this helps :-).