Skip to content

Commit d25c26e

Browse files
Eric WongJunio C Hamano
authored andcommitted
git-svn: exit with status 1 for test failures
Some versions of the SVN libraries cause die() to exit with 255, and 40cf043 tightened up test_expect_failure to reject return values >128. Signed-off-by: Eric Wong <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 747fa12 commit d25c26e

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

git-svn.perl

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
$ENV{LC_ALL} = 'C';
2222
$| = 1; # unbuffer STDOUT
2323

24+
sub fatal (@) { print STDERR $@; exit 1 }
2425
# If SVN:: library support is added, please make the dependencies
2526
# optional and preserve the capability to use the command-line client.
2627
# use eval { require SVN::... } to make it lazy load
@@ -569,7 +570,7 @@ sub commit_lib {
569570
$no = 1;
570571
}
571572
}
572-
close $fh or croak $?;
573+
close $fh or exit 1;
573574
if (! defined $r_new && ! defined $cmt_new) {
574575
unless ($no) {
575576
die "Failed to parse revision information\n";
@@ -868,13 +869,16 @@ sub commit_diff {
868869
print "Committed $_[0]\n";
869870
}, @lock)
870871
);
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 $@;
878882
$_message = $_file = undef;
879883
return $rev_committed;
880884
}

0 commit comments

Comments
 (0)