sub git_unquote ($) {
return $_[0] unless ($_[0] =~ /\A"(.*)"\z/);
$_[0] = $1;
- $_[0] =~ s/\\([\\"abfnrtv])/$GIT_ESC{$1}/g;
- $_[0] =~ s/\\([0-7]{1,3})/chr(oct($1))/ge;
+ $_[0] =~ s!\\([\\"abfnrtv]|[0-3][0-7]{2})!$GIT_ESC{$1}//chr(oct($1))!ge;
$_[0];
}
sub git_quote ($) {
if ($_[0] =~ s/([\\"\a\b\f\n\r\t\013]|[^[:print:]])/
- '\\'.($ESC_GIT{$1}||sprintf("%0o",ord($1)))/egs) {
+ '\\'.($ESC_GIT{$1}||sprintf("%03o",ord($1)))/egs) {
return qq{"$_[0]"};
}
$_[0];
my ($self) = @_;
my $ret = '???';
# don't show full FS path, basename should be OK:
- if ($self->{git_dir} =~ m!/([^/]+)(?:/\.git)?\z!) {
- $ret = "/path/to/$1";
+ if ($self->{git_dir} =~ m!/([^/]+)(?:/*\.git/*)?\z!) {
+ $ret = "$1.git";
}
wantarray ? ($ret) : $ret;
}
push(@$inflight, $oid, $cb, $arg);
}
-sub async_prefetch {
- my ($self, $oid, $cb, $arg) = @_;
- if (my $inflight = $self->{inflight}) {
- # we could use MAX_INFLIGHT here w/o the halving,
- # but lets not allow one client to monopolize a git process
- if (scalar(@$inflight) < int(MAX_INFLIGHT/2)) {
- print { $self->{out} } $oid, "\n" or
- $self->fail("write error: $!");
- return push(@$inflight, $oid, $cb, $arg);
- }
- }
- undef;
-}
-
sub extract_cmt_time {
my ($bref, undef, undef, undef, $modified) = @_;