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
d25c26e771fdf771f264dc85be348719886d354f
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
@@ -569,7 +570,7 @@ sub commit_lib {
570
$no = 1;
571
}
572
}
572
- close $fh or croak $?;
573
+ close $fh or exit 1;
574
if (! defined $r_new && ! defined $cmt_new) {
575
unless ($no) {
576
die "Failed to parse revision information\n";
@@ -868,13 +869,16 @@ sub commit_diff {
869
print "Committed $_[0]\n";
870
}, @lock)
871
);
871
- my $mods = libsvn_checkout_tree($ta, $tb, $ed);
872
- if (@$mods == 0) {
873
- print "No changes\n$ta == $tb\n";
874
- $ed->abort_edit;
875
- } else {
876
- $ed->close_edit;
877
- }
872
+ eval {
873
+ my $mods = libsvn_checkout_tree($ta, $tb, $ed);
874
+ if (@$mods == 0) {
875
+ print "No changes\n$ta == $tb\n";
876
+ $ed->abort_edit;
877
+ } else {
878
+ $ed->close_edit;
879
+ }
880
+ };
881
+ fatal "$@\n" if $@;
882
$_message = $_file = undef;
883
return $rev_committed;
884
}