Code

Terminate diff-* on non-zero exit from GIT_EXTERNAL_DIFF
authorJunio C Hamano <junkio@cox.net>
Wed, 4 May 2005 08:38:06 +0000 (01:38 -0700)
committerJunio C Hamano <junkio@cox.net>
Wed, 4 May 2005 08:38:06 +0000 (01:38 -0700)
commit6fa28064b0c9da9c2c8696b4eac28ee5beaee469
tree514741f37d09ebcbef1758e90391a7857be90ccd
parentae7c0c92c0713307986bcd1fb54fa0694aae962a
Terminate diff-* on non-zero exit from GIT_EXTERNAL_DIFF

(slightly updated from the version posted to the GIT mailing list
with small bugfixes).

This patch changes the git-apply-patch-script to exit non-zero when
the patch cannot be applied.  Previously, the external diff driver
deliberately ignored the exit status of GIT_EXTERNAL_DIFF command,
which was a design mistake.  It now stops the processing when
GIT_EXTERNAL_DIFF exits non-zero, so the damages from running
git-diff-* with git-apply-patch-script between two wrong trees can be
contained.

The "diff" command line generated by the built-in driver is changed to
always exit 0 in order to match this new behaviour.  I know Pasky does
not use GIT_EXTERNAL_DIFF yet, so this change should not break Cogito,
either.

Signed-off-by: Junio C Hamano <junkio@cox.net>
diff.c
git-apply-patch-script