Skip to content

Commit

Permalink
git-svn: check error code of send_txstream
Browse files Browse the repository at this point in the history
Not checking the error code of a function used to transform and
send data makes me nervous.  It currently returns "undef" on
success; so die if we get any result other than "undef" because
it's likely something went wrong somewhere.  I really wish this
function returned an MD5 like send_stream (or better yet, SHA1)
for verification.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
  • Loading branch information
Eric Wong committed Sep 5, 2008
1 parent 8598db9 commit 991255c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -3697,7 +3697,11 @@ sub chg_file {
my $atd = $self->apply_textdelta($fbat, $exp_a, $pool);
if (-s $fh_a) {
my $txstream = SVN::TxDelta::new ($fh_a, $fh_b, $pool);
SVN::TxDelta::send_txstream($txstream, @$atd, $pool);
my $res = SVN::TxDelta::send_txstream($txstream, @$atd, $pool);
if (defined $res) {
die "Unexpected result from send_txstream: $res\n",
"(SVN::Core::VERSION: $SVN::Core::VERSION)\n";
}
} else {
my $got = SVN::TxDelta::send_stream($fh_b, @$atd, $pool);
die "Checksum mismatch\nexpected: $exp_b\ngot: $got\n"
Expand Down

0 comments on commit 991255c

Please sign in to comment.