aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2006-11-24 22:38:18 -0800
committerJunio C Hamano <junkio@cox.net>2006-12-13 01:48:44 -0800
commitb42a044f5942c64bbc94aa2f4637d8290748e634 (patch)
treefdc074a8265fe200e8f6ccf1505984ccf46e1207
parent0d7a6e4ef9e2dc458a9a56ab73638d97f4e75d87 (diff)
downloadgit-b42a044f5942c64bbc94aa2f4637d8290748e634.tar.gz
git-b42a044f5942c64bbc94aa2f4637d8290748e634.tar.xz
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>
-rwxr-xr-xgit-svn.perl20
1 files changed, 12 insertions, 8 deletions
diff --git a/git-svn.perl b/git-svn.perl
index b53273eae..e8b5c0966 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -21,6 +21,7 @@ $ENV{TZ} = 'UTC';
$ENV{LC_ALL} = 'C';
$| = 1; # unbuffer STDOUT
+sub fatal (@) { print STDERR $@; exit 1 }
# If SVN:: library support is added, please make the dependencies
# optional and preserve the capability to use the command-line client.
# use eval { require SVN::... } to make it lazy load
@@ -571,7 +572,7 @@ sub commit_lib {
$no = 1;
}
}
- close $fh or croak $?;
+ close $fh or exit 1;
if (! defined $r_new && ! defined $cmt_new) {
unless ($no) {
die "Failed to parse revision information\n";
@@ -873,13 +874,16 @@ sub commit_diff {
print "Committed $_[0]\n";
}, @lock)
);
- my $mods = libsvn_checkout_tree($ta, $tb, $ed);
- if (@$mods == 0) {
- print "No changes\n$ta == $tb\n";
- $ed->abort_edit;
- } else {
- $ed->close_edit;
- }
+ eval {
+ my $mods = libsvn_checkout_tree($ta, $tb, $ed);
+ if (@$mods == 0) {
+ print "No changes\n$ta == $tb\n";
+ $ed->abort_edit;
+ } else {
+ $ed->close_edit;
+ }
+ };
+ fatal "$@\n" if $@;
$_message = $_file = undef;
return $rev_committed;
}