summaryrefslogtreecommitdiff
path: root/t/t0021
diff options
context:
space:
mode:
authorLibravatar Johannes Schindelin <johannes.schindelin@gmx.de>2021-02-12 15:50:04 +0100
committerLibravatar Johannes Schindelin <johannes.schindelin@gmx.de>2021-02-12 15:50:04 +0100
commit2d1142a3e8455af1bdab2cb19dfaf428cdc03459 (patch)
treeedf2da177d02dc723e12a7057e1e4906d0f8aa06 /t/t0021
parentGit 2.27 (diff)
parentGit 2.26.3 (diff)
downloadtgif-2d1142a3e8455af1bdab2cb19dfaf428cdc03459.tar.xz
Sync with 2.26.3
* maint-2.26: Git 2.26.3 Git 2.25.5 Git 2.24.4 Git 2.23.4 Git 2.22.5 Git 2.21.4 Git 2.20.5 Git 2.19.6 Git 2.18.5 Git 2.17.6 unpack_trees(): start with a fresh lstat cache run-command: invalidate lstat cache after a command finished checkout: fix bug that makes checkout follow symlinks in leading path
Diffstat (limited to 't/t0021')
-rw-r--r--t/t0021/rot13-filter.pl21
1 files changed, 18 insertions, 3 deletions
diff --git a/t/t0021/rot13-filter.pl b/t/t0021/rot13-filter.pl
index cd32a82da5..7bb93768f3 100644
--- a/t/t0021/rot13-filter.pl
+++ b/t/t0021/rot13-filter.pl
@@ -2,9 +2,15 @@
# Example implementation for the Git filter protocol version 2
# See Documentation/gitattributes.txt, section "Filter Protocol"
#
-# 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).
+# Usage: rot13-filter.pl [--always-delay] <log path> <capabilities>
+#
+# Log path defines a debug log file that the script writes to. The
+# subsequent arguments define a list of supported protocol capabilities
+# ("clean", "smudge", etc).
+#
+# When --always-delay is given all pathnames with the "can-delay" flag
+# that don't appear on the list bellow are delayed with a count of 1
+# (see more below).
#
# This implementation supports special test cases:
# (1) If data with the pathname "clean-write-fail.r" is processed with
@@ -53,6 +59,13 @@ use IO::File;
use Git::Packet;
my $MAX_PACKET_CONTENT_SIZE = 65516;
+
+my $always_delay = 0;
+if ( $ARGV[0] eq '--always-delay' ) {
+ $always_delay = 1;
+ shift @ARGV;
+}
+
my $log_file = shift @ARGV;
my @capabilities = @ARGV;
@@ -134,6 +147,8 @@ while (1) {
if ( $buffer eq "can-delay=1" ) {
if ( exists $DELAY{$pathname} and $DELAY{$pathname}{"requested"} == 0 ) {
$DELAY{$pathname}{"requested"} = 1;
+ } elsif ( !exists $DELAY{$pathname} and $always_delay ) {
+ $DELAY{$pathname} = { "requested" => 1, "count" => 1 };
}
} elsif ($buffer =~ /^(ref|treeish|blob)=/) {
print $debug " $buffer";