Skip to content

Commit

Permalink
git-svn: error out when the SVN connection fails during a fetch
Browse files Browse the repository at this point in the history
finish_report does seem to return a useful value indicating success
or failure, so we'll just set a flag when close_edit is called
(it is not called on failures, nor is abort_edit) and check
the flag before proceeding.

Thanks to Pazu for pointing this out.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
Eric Wong authored and Junio C Hamano committed Nov 28, 2006
1 parent c3e4393 commit dad73c0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -2939,6 +2939,9 @@ sub libsvn_fetch_delta {
$reporter->set_path('', $last_rev, 0, @lock, $pool);
$reporter->finish_report($pool);
$pool->clear;
unless ($ed->{git_commit_ok}) {
die "SVN connection failed somewhere...\n";
}
libsvn_log_entry($rev, $author, $date, $msg, [$last_commit]);
}

Expand Down Expand Up @@ -3193,6 +3196,9 @@ sub libsvn_new_tree {
$reporter->set_path('', $rev, 1, @lock, $pool);
$reporter->finish_report($pool);
$pool->clear;
unless ($ed->{git_commit_ok}) {
die "SVN connection failed somewhere...\n";
}
} else {
open my $gui, '| git-update-index -z --index-info' or croak $!;
libsvn_traverse($gui, '', $SVN->{svn_path}, $rev);
Expand Down Expand Up @@ -3506,7 +3512,8 @@ sub abort_edit {

sub close_edit {
my $self = shift;
close $self->{gui} or croak;
close $self->{gui} or croak $!;
$self->{git_commit_ok} = 1;
$self->SUPER::close_edit(@_);
}

Expand Down

0 comments on commit dad73c0

Please sign in to comment.