Skip to content

Commit

Permalink
diff-no-index: simplify argv index calculation
Browse files Browse the repository at this point in the history
Since 16bb3d7 (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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
rscharfe authored and gitster committed Sep 7, 2022
1 parent 07a6f94 commit 2b43dd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion diff-no-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2b43dd0

Please sign in to comment.