Skip to content

Commit

Permalink
batdiff: Support filenames with special characters
Browse files Browse the repository at this point in the history
  • Loading branch information
HE7086 committed Aug 14, 2024
1 parent aef5a42 commit 4764b00
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/batdiff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ print_bat_diff() {

# Diff git file.
if "$SUPPORTS_BAT_DIFF"; then
"$EXECUTABLE_GIT" diff "${GIT_ARGS[@]}" --name-only "${files[0]}" \
| xargs "$EXECUTABLE_BAT" --diff --diff-context="$OPT_CONTEXT" "${BAT_ARGS[@]}"
"$EXECUTABLE_GIT" diff "${GIT_ARGS[@]}" --name-only -z "${files[0]}" \
| xargs --null "$EXECUTABLE_BAT" --diff --diff-context="$OPT_CONTEXT" "${BAT_ARGS[@]}"
else
"$EXECUTABLE_GIT" diff "${GIT_ARGS[@]}" "${files[0]}" | "$EXECUTABLE_BAT" --language=diff - "${BAT_ARGS[@]}"
fi
Expand Down

0 comments on commit 4764b00

Please sign in to comment.