diff --git a/clang/tools/clang-format/git-clang-format b/clang/tools/clang-format/git-clang-format index 40e848d55a8c..c7e15eb7b483 100755 --- a/clang/tools/clang-format/git-clang-format +++ b/clang/tools/clang-format/git-clang-format @@ -327,6 +327,8 @@ def extract_lines(patch_file): line_count = int(match.group(3)) if line_count == 0: line_count = 1 + if start_line == 0: + continue matches.setdefault(filename, []).append(Range(start_line, line_count)) return matches