Merge branch 'rs/diff-caret-bang-with-parents'

"git diff rev^!" did not show combined diff to go to the rev from
its parents.

* rs/diff-caret-bang-with-parents:
  diff: support ^! for merges
  revisions.txt: unspecify order of resolved parts of ^!
  revision: use strtol_i() for exclude_parent
This commit is contained in:
Junio C Hamano
2022-10-25 17:11:43 -07:00
5 changed files with 35 additions and 13 deletions

View File

@ -2113,9 +2113,8 @@ static int handle_revision_arg_1(const char *arg_, struct rev_info *revs, int fl
int exclude_parent = 1;
if (mark[2]) {
char *end;
exclude_parent = strtoul(mark + 2, &end, 10);
if (*end != '\0' || !exclude_parent)
if (strtol_i(mark + 2, 10, &exclude_parent) ||
exclude_parent < 1)
return -1;
}