]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Preserve the exit code of the diff command in binary_safe_diff.sh
authorDimitry Andric <dimitry@andric.com>
Sun, 13 Dec 2015 10:21:43 +0000 (02:21 -0800)
committerepriestley <git@epriestley.com>
Sun, 13 Dec 2015 10:21:43 +0000 (02:21 -0800)
Summary:
Some versions of Subversion (1.9 in any case, maybe others) will
duplicate diff headers, if the diff command run through --diff-cmd
returns 0.

This lead to T9970, where the addition of a new file with properties
only shows the properties themselves in the review, not the content of
the new file.

Test Plan: This is a trivial change, is a test needed at all?

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: stevenh, Korvin, eadler

Differential Revision: https://secure.phabricator.com/D14755

scripts/repository/binary_safe_diff.sh

index 1473e8044223a9753fc2305db8679821b023eb1b..b51d31a60ad4cdb7fcc9d20ef22b19c9d78c4b9b 100755 (executable)
@@ -1,6 +1,8 @@
 #!/bin/sh
 
 diff "$@"
-if [ "$?" = "2" ]; then
+RES="$?"
+if [ "$RES" = "2" ]; then
   exit 1
 fi
+exit "$RES"