summaryrefslogtreecommitdiff
path: root/t/t0021
diff options
context:
space:
mode:
authorLars Schneider <larsxschneider@gmail.com>2017-06-01 10:22:00 +0200
committerJunio C Hamano <gitster@pobox.com>2017-06-26 10:36:00 -0700
commite1ec4721d61d0cad59f36620b2cb15853eb5ef67 (patch)
treea048d10b8b21553b307cb2787903a2a3a7b1fabe /t/t0021
parent58ec9cb35baaad29f11e16faa2e032650c17d77d (diff)
downloadgit-e1ec4721d61d0cad59f36620b2cb15853eb5ef67.tar.gz
t0021: make debug log file name configurable
The "rot13-filter.pl" helper wrote its debug logs always to "rot13-filter.log". Make this configurable by defining the log file as first parameter of "rot13-filter.pl". This is useful if "rot13-filter.pl" is configured multiple times similar to the subsequent patch 'convert: add "status=delayed" to filter process protocol'. Signed-off-by: Lars Schneider <larsxschneider@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0021')
-rw-r--r--t/t0021/rot13-filter.pl8
1 files changed, 5 insertions, 3 deletions
diff --git a/t/t0021/rot13-filter.pl b/t/t0021/rot13-filter.pl
index 617f581e56..0b943bb377 100644
--- a/t/t0021/rot13-filter.pl
+++ b/t/t0021/rot13-filter.pl
@@ -2,8 +2,9 @@
# Example implementation for the Git filter protocol version 2
# See Documentation/gitattributes.txt, section "Filter Protocol"
#
-# The script takes the list of supported protocol capabilities as
-# arguments ("clean", "smudge", etc).
+# The first argument defines a debug log file that the script write to.
+# All remaining arguments define a list of supported protocol
+# capabilities ("clean", "smudge", etc).
#
# This implementation supports special test cases:
# (1) If data with the pathname "clean-write-fail.r" is processed with
@@ -24,9 +25,10 @@ use warnings;
use IO::File;
my $MAX_PACKET_CONTENT_SIZE = 65516;
+my $log_file = shift @ARGV;
my @capabilities = @ARGV;
-open my $debug, ">>", "rot13-filter.log" or die "cannot open log file: $!";
+open my $debug, ">>", $log_file or die "cannot open log file: $!";
sub rot13 {
my $str = shift;