diff --git a/clang/tools/clang-format/git-clang-format b/clang/tools/clang-format/git-clang-format index e709803d9a3f1..fe2dd283d403e 100755 --- a/clang/tools/clang-format/git-clang-format +++ b/clang/tools/clang-format/git-clang-format @@ -419,7 +419,7 @@ def compute_diff(commits, files, staged, diff_common_commit): if len(commits) == 2: git_tool = "diff-tree" if diff_common_commit: - commits = [f"{commits[0]}...{commits[1]}"] + extra_args += ["--merge-base"] elif staged: extra_args += ["--cached"]