summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2017-11-05 22:38:32 +0100
committerJunio C Hamano <gitster@pobox.com>2017-11-07 09:54:41 +0900
commit00df039faa32a278029d1af27851e6fa15f4fb27 (patch)
tree815dc3df7b2f9d82b6b4f6358a4cf5582f9c3ac4
parented17d26245b27df1694a4efaf386e6924aefaee5 (diff)
downloadgit-00df039faa32a278029d1af27851e6fa15f4fb27.tar.gz
t0021/rot13-filter: improve error message
If there is no new line at the end of something it receives, the packet_txt_read() function die()s, but it's difficult to debug without much context. Let's give a bit more information when that happens. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--t/t0021/rot13-filter.pl3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/t0021/rot13-filter.pl b/t/t0021/rot13-filter.pl
index 37cecd8654..f31ff595fe 100644
--- a/t/t0021/rot13-filter.pl
+++ b/t/t0021/rot13-filter.pl
@@ -96,7 +96,8 @@ sub packet_bin_read {
sub packet_txt_read {
my ( $res, $buf ) = packet_bin_read();
unless ( $res == -1 or $buf eq '' or $buf =~ s/\n$// ) {
- die "A non-binary line MUST be terminated by an LF.";
+ die "A non-binary line MUST be terminated by an LF.\n"
+ . "Received: '$buf'";
}
return ( $res, $buf );
}