lint-history: fix broken --refs option

Commit 3e153806ff (lint-history: Add --refs argument, 2021-12-30)
added a --refs argument to lint-history, but attempting to inject it
directly into the parsed args fields, bypassing some of the important
logic from FilteringOptions.parse_args() -- particularly the bit where
it translates an empty --refs into a request for '--all' as as list of
references.  I somehow overlooked this in my earlier review.  Fix the
problem now.

Signed-off-by: Elijah Newren <newren@gmail.com>
pull/399/head
Elijah Newren 2 years ago
parent 5651f62f4c
commit 9cf6121b34

@ -160,9 +160,11 @@ if lint_args.relevant:
exec('def is_relevant(filename):\n '+'\n '.join(body.splitlines()),
globals())
lint_args.filenames_important = True
args = fr.FilteringOptions.default_options()
input_args = []
if lint_args.refs:
input_args = ["--args",] + lint_args.refs
args = fr.FilteringOptions.parse_args(input_args, error_on_empty = False)
args.force = True
args.refs = lint_args.refs if lint_args.refs is not None else []
if lint_args.filenames_important:
tmpdir = tempfile.mkdtemp().encode()
cat_file_process = subprocess.Popen(['git', 'cat-file', '--batch'],

Loading…
Cancel
Save