git-svn: check error code of send_txstream
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>
Eric Wong committed
Aug 31, 2008 at 19:45 UTC
991255c634500fe51a70aae6a8e7c8d7b73db0cc
1 file changed
+5
-1
git-svn.perl
+5
-1
@@ -3697,7 +3697,11 @@ sub chg_file {
3697
my $atd = $self->apply_textdelta($fbat, $exp_a, $pool);
3698
if (-s $fh_a) {
3699
my $txstream = SVN::TxDelta::new ($fh_a, $fh_b, $pool);
3700
- SVN::TxDelta::send_txstream($txstream, @$atd, $pool);
3700
+ my $res = SVN::TxDelta::send_txstream($txstream, @$atd, $pool);
3701
+ if (defined $res) {
3702
+ die "Unexpected result from send_txstream: $res\n",
3703
+ "(SVN::Core::VERSION: $SVN::Core::VERSION)\n";
3704
+ }
3705
} else {
3706
my $got = SVN::TxDelta::send_stream($fh_b, @$atd, $pool);
3707
die "Checksum mismatch\nexpected: $exp_b\ngot: $got\n"