chdir $cachedir or fail "chdir $cachedir: $!";
-our ($service,$specpath,$spechost,$subdir);
+our ($service,$specpath,$spechost,$extraparams,$subdir);
our ($tmpd,$gitd,$lock);
our ($fetch,$url);
my $hex_len = xread 4;
fail "Bad hex in packet length" unless $hex_len =~ m|^[0-9a-fA-F]{4}$|;
my $line = xread -4 + hex $hex_len;
- unless (($service,$specpath,$spechost) = $line =~
- m|^(git-[a-z-]+) /*([!-~ ]+)\0host=([!-~]+)\0|) {
+ unless (($service,$specpath,$spechost,$extraparams) = $line =~
+ m|^(git-[a-z-]+) /*([!-~ ]+)\0host=([!-~]+)\0(\0(?:[^\0]+\0)+)?|) {
$line =~ s|[^ -~]+| |g;
gitfail "unknown/unsupported instruction `$line'"
}
chdir $gitd or fail "chdir $gitd: $!";
+ if ($extraparams) {
+ $extraparams =~ s/^\0(.+)\0$/$1/;
+ $extraparams =~ s/\0/:/g;
+ $ENV{GIT_PROTOCOL} = "$extraparams";
+ }
+
exec qw(git-upload-pack --strict), "--timeout=$servetimeout", qw(.)
or fail "exec git-upload-pack: $!";
}