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

[#31] Force git diff to use the default prefixes. #38

Merged
merged 1 commit into from
Mar 11, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion apply-format
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,11 @@ else # Diff-only.
readonly patch_dest=/dev/stdout
fi

declare git_args=(git diff -U0 --no-color)
# To support git when it is configured to use a non-default prefix, use
# --src-prefix and --dst-prefix to set the default prefixes explicitly. We
# don't use the newer --default-prefix option because we want to support git
# versions older than 2.41.
declare git_args=(git diff -U0 --no-color --src-prefix=a/ --dst-prefix=b/)
[ "$staged" = true ] && git_args+=("--staged")

# $format_diff may contain a command ("python") and the script to excute, so we
Expand Down