Fix git cl format when it finds no clang-formattable files.

Currently, if git cl format does not find any clang-formattable files,
either in the path provided on the command line or in the CL as a whole,
then it applies clang-format to all changes in the CL. This CL fixes
this by changing git cl format to not clang-format when it does not find
any changed files that are clang-formattable.

Review URL: https://codereview.chromium.org/1734863002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@298971 0039d316-1c4b-4281-b951-d872f2087c98
changes/01/332501/1
sammc@chromium.org 9 years ago
parent ab373715fd
commit 0b35f5d745

@ -3584,8 +3584,8 @@ def CMDformat(parser, args):
# formatted. This is used to block during the presubmit.
return_value = 0
if opts.full:
if clang_diff_files:
if opts.full:
cmd = [clang_format_tool]
if not opts.dry_run and not opts.diff:
cmd.append('-i')

Loading…
Cancel
Save