mirror of
https://github.com/eth-p/bat-extras.git
synced 2025-01-20 20:28:37 +01:00
batdiff: Support filtering diffs by directory
This brings parity between using `delta` and `bat --diff`. Previously, only `delta` supported this use case.
This commit is contained in:
parent
4039859b62
commit
2e1e768559
@ -139,7 +139,8 @@ print_bat_diff() {
|
||||
|
||||
# Diff git file.
|
||||
if "$SUPPORTS_BAT_DIFF"; then
|
||||
"$EXECUTABLE_BAT" --diff --diff-context="$OPT_CONTEXT" "${files[0]}" "${BAT_ARGS[@]}"
|
||||
"$EXECUTABLE_GIT" diff "${GIT_ARGS[@]}" --name-only "${files[0]}" \
|
||||
| xargs "$EXECUTABLE_BAT" --diff --diff-context="$OPT_CONTEXT" "${BAT_ARGS[@]}"
|
||||
else
|
||||
"$EXECUTABLE_GIT" diff "${GIT_ARGS[@]}" "${files[0]}" | "$EXECUTABLE_BAT" --language=diff - "${BAT_ARGS[@]}"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user