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 JSON output for created / deleted empty files #4

Merged
merged 6 commits into from
Jul 31, 2024

Conversation

nimrodkor
Copy link

@nimrodkor nimrodkor commented Jul 30, 2024

User description

Until Wilfred#259 is addressed, this is a workaround specifically for the JSON output. Instead of crashing when calculating the permissions, returning the code that git returns and acting accordingly (marking the file as created / deleted). Example outputs:

$ GIT_EXTERNAL_DIFF=../difft DFT_UNSTABLE=yes DFT_DISPLAY=json git diff main...999c619
{"language":"Python","path":"python/__init__.py","status":"created"}
GIT_EXTERNAL_DIFF=../difft DFT_UNSTABLE=yes DFT_DISPLAY=json git diff 999c619...HEAD
{"language":"Python","path":"python/__init__.py","status":"deleted"}

Generated description

A pull request with no changes.

Topics

@nimrodkor nimrodkor requested a review from a team July 30, 2024 19:28
@nimrodkor nimrodkor merged commit 07ab1c5 into baz-difftastic Jul 31, 2024
14 checks passed
@nimrodkor nimrodkor deleted the handle-non-existant-files-correctly branch July 31, 2024 07:54
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 this pull request may close these issues.

2 participants