From 51cbf212abb208d8577ce70add2115cca2a4be5d Mon Sep 17 00:00:00 2001 From: Reini Urban Date: Mon, 15 Jul 2024 08:30:42 +0200 Subject: [PATCH] Fix for config diff.noprefix --- apply-format | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apply-format b/apply-format index 8bcc839..84dfb49 100755 --- a/apply-format +++ b/apply-format @@ -320,9 +320,13 @@ else # Diff-only. done fi + gitpathprefix=-p1 + if [ "$(git config diff.noprefix)" == "true" ]; then + gitpathprefix=-p0 + fi "${git_args[@]}" "$@" \ | "${format_diff_args[@]}" \ - -p1 \ + $gitpathprefix \ -style="$style" \ -iregex="$exclusions_regex"'.*\.(c|cpp|cxx|cc|h|hpp|m|mm|js|java)' \ > "$patch_dest" \