Skip to content

Commit 0115e5d

Browse files
Denton-Lgitster
authored andcommitted
git-diff.txt: document return code of --no-index
Within diff_no_index(), we have the following: revs->diffopt.flags.exit_with_status = 1; ... /* * The return code for --no-index imitates diff(1): * 0 = no changes, 1 = changes, else error */ return diff_result_code(&revs->diffopt, 0); Which means when `git diff` is run in `--no-index` mode, `--exit-code` is implied. However, the documentation for this is missing in git-diff.txt. Add a note about how `--exit-code` is implied in the `--no-index` documentation to cover this documentation blindspot. Signed-off-by: Denton Liu <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5fa0f52 commit 0115e5d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Documentation/git-diff.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ two blob objects, or changes between two files on disk.
3636
running the command in a working tree controlled by Git and
3737
at least one of the paths points outside the working tree,
3838
or when running the command outside a working tree
39-
controlled by Git.
39+
controlled by Git. This form implies `--exit-code`.
4040

4141
'git diff' [<options>] --cached [<commit>] [--] [<path>...]::
4242

0 commit comments

Comments
 (0)