clang-format: fix commit-filter off-by-one

The filter range excluded $first_commit itself, so the first commit on
the branch was never rewritten and single-commit branches failed.

Ticket: #9097
pull/16253/head
Juliana Fajardini 1 month ago committed by Victor Julien
parent 4f47e43a33
commit b778e8c06d

@ -578,7 +578,7 @@ function ReformatCommitsOnBranch {
# Tolerate exit code 1, it means the tree filter reformatted files.
git filter-branch --force --tree-filter \
"$GIT_CLANG_FORMAT --extensions c,h $first_commit^ || [ \$? -le 1 ]" \
-- $first_commit..HEAD
-- $first_commit^..HEAD
if [ $? -ne 0 ]; then
Die "Cannot rewrite branch. git filter-branch failed"
fi

Loading…
Cancel
Save