From: René Scharfe Date: Wed, 7 Sep 2022 11:45:42 +0000 (+0200) Subject: diff-no-index: simplify argv index calculation X-Git-Tag: v2.38.0-rc0~18^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2b43dd0eb5f3f035b9bd9d019ec405dd55ec15e1;p=thirdparty%2Fgit.git diff-no-index: simplify argv index calculation Since 16bb3d714d (diff --no-index: use parse_options() instead of diff_opt_parse(), 2019-03-24) argc must be 2 if we reach the loop, i.e. argc - 2 == 0. Remove that inconsequential term. Signed-off-by: René Scharfe Signed-off-by: Junio C Hamano --- diff --git a/diff-no-index.c b/diff-no-index.c index a18f6c3c63..18edbdf4b5 100644 --- a/diff-no-index.c +++ b/diff-no-index.c @@ -267,7 +267,7 @@ int diff_no_index(struct rev_info *revs, } FREE_AND_NULL(options); for (i = 0; i < 2; i++) { - const char *p = argv[argc - 2 + i]; + const char *p = argv[i]; if (!strcmp(p, "-")) /* * stdin should be spelled as "-"; if you have