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 git diff call #2372

Merged
merged 1 commit into from
Nov 23, 2021
Merged

Fix git diff call #2372

merged 1 commit into from
Nov 23, 2021

Conversation

fthomas
Copy link
Member

@fthomas fthomas commented Nov 23, 2021

git diff fails if there is a branch and file with the same name:

2021-11-23 14:16:10,530 INFO  Create branch update/bloop-config-1.4.11
2021-11-23 14:16:18,210 ERROR Steward com-lihaoyi/mill failed
git diff --name-only main update/bloop-config-1.4.11' exited with code 128
fatal: ambiguous argument 'main': both revision and filename
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

This change therefore adds -- after the branches in our git diff call.

`git diff` fails if there is a branch and file with the same name:
```
2021-11-23 14:16:10,530 INFO  Create branch update/bloop-config-1.4.11
2021-11-23 14:16:18,210 ERROR Steward com-lihaoyi/mill failed
git diff --name-only main update/bloop-config-1.4.11' exited with code 128
fatal: ambiguous argument 'main': both revision and filename
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
```
This change therefore adds `--` after the branches in our `git diff` call.
@fthomas fthomas added the bug Something isn't working label Nov 23, 2021
@fthomas fthomas added this to the 0.14.0 milestone Nov 23, 2021
@codecov
Copy link

codecov bot commented Nov 23, 2021

Codecov Report

Merging #2372 (54d2d84) into master (a944e32) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2372   +/-   ##
=======================================
  Coverage   80.46%   80.46%           
=======================================
  Files         139      139           
  Lines        2396     2396           
  Branches       51       51           
=======================================
  Hits         1928     1928           
  Misses        468      468           
Impacted Files Coverage Δ
...n/scala/org/scalasteward/core/git/FileGitAlg.scala 98.33% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a944e32...54d2d84. Read the comment docs.

@fthomas fthomas merged commit 1ae1224 into master Nov 23, 2021
@fthomas fthomas deleted the topic/fix-git-diff branch November 23, 2021 20:00
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 this pull request may close these issues.

1 participant