From: Eric Wong Date: Tue, 28 Nov 2023 14:56:24 +0000 (+0000) Subject: git: speed up Git->new by 5% or so X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56f844218d0a7ed2e10952715902572c28313517;p=thirdparty%2Fpublic-inbox.git git: speed up Git->new by 5% or so This becomes noticeable when loading lots of coderepos on my local mirror of git.kernel.org now that we can load repos from cindex. --- diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index a374649f1..235a35cd9 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -91,8 +91,9 @@ sub git_quote ($) { sub new { my ($class, $git_dir) = @_; + $git_dir .= '/'; $git_dir =~ tr!/!/!s; - $git_dir =~ s!/*\z!!s; + chop $git_dir; # may contain {-tmp} field for File::Temp::Dir bless { git_dir => $git_dir }, $class }