]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Simplify diff exit code handling.
authorDimitry Andric <dimitry@andric.com>
Sun, 13 Dec 2015 10:35:07 +0000 (02:35 -0800)
committerepriestley <git@epriestley.com>
Sun, 13 Dec 2015 10:35:07 +0000 (02:35 -0800)
Summary:
This fixes T9970 in an alternate manner, with the same effect: the
binary_safe_diff.sh script returns 0 if the diff succeeds, 1 in all
other cases.

Test Plan:
Tested locally with a fixed binary_safe_diff.sh, resulting in this
correct review:

https://reviews.freebsd.org/D4542

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: eadler, Korvin, stevenh

Maniphest Tasks: T9970

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

scripts/repository/binary_safe_diff.sh

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