Merge branch 'jc/line-log-takes-no-pathspec'

"git log -L<range>:<path>" is documented to take no pathspec, but
this was not enforced by the command line option parser, which has
been corrected.

* jc/line-log-takes-no-pathspec:
  log: diagnose -L used with pathspec as an error
This commit is contained in:
Junio C Hamano
2020-11-18 13:32:52 -08:00
2 changed files with 25 additions and 0 deletions

View File

@ -206,6 +206,9 @@ static void cmd_log_init_finish(int argc, const char **argv, const char *prefix,
if (argc > 1)
die(_("unrecognized argument: %s"), argv[1]);
if (rev->line_level_traverse && rev->prune_data.nr)
die(_("-L<range>:<file> cannot be used with pathspec"));
memset(&w, 0, sizeof(w));
userformat_find_requirements(NULL, &w);