Skip to content

Commit dd161e3

Browse files
authored
clang-format-diff: compare to most recent tag on current branch (#73)
1 parent 75d1b2f commit dd161e3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

ClangFormat.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ function(swift_setup_clang_format)
231231
create_clang_format_targets(
232232
TOP_LEVEL ${top_level_project}
233233
ALL_COMMAND git ls-files ${patterns} | xargs ${${PROJECT_NAME}_CLANG_FORMAT} -i
234-
DIFF_COMMAND git diff --diff-filter=ACMRTUXB --name-only --line-prefix=`git rev-parse --show-toplevel`/ HEAD -- ${patterns}
235-
| xargs -t ${${PROJECT_NAME}_CLANG_FORMAT} -i
234+
DIFF_COMMAND git describe --tags --abbrev=0 --always
235+
| xargs -I % git diff --diff-filter=ACMRTUXB --name-only --line-prefix=`git rev-parse --show-toplevel`/ % -- ${patterns}
236+
| xargs ${${PROJECT_NAME}_CLANG_FORMAT} -i
236237
)
237238
endfunction()

0 commit comments

Comments
 (0)