Skip to content

Commit a394ac0

Browse files
committed
[clang-format] Fix a bug in git-clang-format --binary
This is a rework of #74176.
1 parent 2a3f119 commit a394ac0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clang/tools/clang-format/git-clang-format

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ def main():
153153
else:
154154
if len(commits) > 2:
155155
die('at most two commits allowed; %d given' % len(commits))
156-
opts.binary=os.path.abspath(opts.binary)
156+
157+
if os.path.dirname(opts.binary):
158+
opts.binary = os.path.abspath(opts.binary)
159+
157160
changed_lines = compute_diff_and_extract_lines(commits, files, opts.staged)
158161
if opts.verbose >= 1:
159162
ignored_files = set(changed_lines)

0 commit comments

Comments
 (0)