Commit c55eecf7 authored by Daniel Cheng's avatar Daniel Cheng Committed by Commit Bot

Make git cl format work with relative paths arguments.

BUG=none

Change-Id: I6864a8ac16393410280f8cdd38719b02a81f6ce1
Reviewed-on: https://chromium-review.googlesource.com/424147Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
parent d3cee645
......@@ -5179,6 +5179,10 @@ def CMDformat(parser, args):
help='Print diff to stdout rather than modifying files.')
opts, args = parser.parse_args(args)
# Normalize any remaining args against the current path, so paths relative to
# the current directory are still resolved as expected.
args = [os.path.join(os.getcwd(), arg) for arg in args]
# git diff generates paths against the root of the repository. Change
# to that directory so clang-format can find files even within subdirs.
rel_base_path = settings.GetRelativeRoot()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment