From 56f844218d0a7ed2e10952715902572c28313517 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 28 Nov 2023 14:56:24 +0000 Subject: 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. --- lib/PublicInbox/Git.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/Git.pm') diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index a374649f..235a35cd 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 } -- cgit v1.2.3-24-ge0c7