git-svn: exit with status 1 for test failures
Some versions of the SVN libraries cause die() to exit with 255, and 40cf043389ef4cdf3e56e7c4268d6f302e387fa0 tightened up test_expect_failure to reject return values >128. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Eric Wong committed
Nov 24, 2006 at 22:38 UTC
b42a044f5942c64bbc94aa2f4637d8290748e634
1 file changed
+12
-8
git-svn.perl
+12
-8
@@ -21,6 +21,7 @@ $ENV{TZ} = 'UTC';
21
$ENV{LC_ALL} = 'C';
22
$| = 1; # unbuffer STDOUT
23
24
+sub fatal (@) { print STDERR $@; exit 1 }
25
# If SVN:: library support is added, please make the dependencies
26
# optional and preserve the capability to use the command-line client.
27
# use eval { require SVN::... } to make it lazy load
@@ -571,7 +572,7 @@ sub commit_lib {
572
$no = 1;
573
}
574
}
574
- close $fh or croak $?;
575
+ close $fh or exit 1;
576
if (! defined $r_new && ! defined $cmt_new) {
577
unless ($no) {
578
die "Failed to parse revision information\n";
@@ -873,13 +874,16 @@ sub commit_diff {
874
print "Committed $_[0]\n";
875
}, @lock)
876
);
876
- my $mods = libsvn_checkout_tree($ta, $tb, $ed);
877
- if (@$mods == 0) {
878
- print "No changes\n$ta == $tb\n";
879
- $ed->abort_edit;
880
- } else {
881
- $ed->close_edit;
882
- }
877
+ eval {
878
+ my $mods = libsvn_checkout_tree($ta, $tb, $ed);
879
+ if (@$mods == 0) {
880
+ print "No changes\n$ta == $tb\n";
881
+ $ed->abort_edit;
882
+ } else {
883
+ $ed->close_edit;
884
+ }
885
+ };
886
+ fatal "$@\n" if $@;
887
$_message = $_file = undef;
888
return $rev_committed;
889
}