From 34a5e1a2d900b5dd9b9c446a3db9fdb3b29e0575 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sun, 25 Feb 2007 23:34:54 +0100 Subject: diff --no-index: also imitate the exit status of diff(1) diff sets the exit status to 0 when no changes were found, to 1 when changes were found, and 2 means error. We imitate this to be able to use "git diff" in the test scripts. (Actually, keeping in line with the rest of git, -1 is returned on error, which corresponds to an exit status 255). To find out if the diff is not empty, a member called "found_changes" was introduced in struct diff_options, which is set in builtin_diff() and fn_out_consume(). Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- diff.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'diff.h') diff --git a/diff.h b/diff.h index b608828261..4043cec04e 100644 --- a/diff.h +++ b/diff.h @@ -75,6 +75,9 @@ struct diff_options { int stat_width; int stat_name_width; + /* this is set by diffcore for DIFF_FORMAT_PATCH */ + int found_changes; + int nr_paths; const char **paths; int *pathlens; -- cgit v1.2.3