unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 3/5] git: rename version() to git_version()
Date: Wed, 12 Apr 2023 00:13:00 +0000	[thread overview]
Message-ID: <20230412001302.685421-4-e@80x24.org> (raw)
In-Reply-To: <20230412001302.685421-1-e@80x24.org>

In case it gets confused with Inbox->version or similar.
---
 lib/PublicInbox/Git.pm        | 10 +++++-----
 lib/PublicInbox/LeiMirror.pm  |  2 +-
 lib/PublicInbox/TestCommon.pm |  2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm
index cc337e5d..fd5bbc6b 100644
--- a/lib/PublicInbox/Git.pm
+++ b/lib/PublicInbox/Git.pm
@@ -52,11 +52,6 @@ my %ESC_GIT = map { $GIT_ESC{$_} => $_ } keys %GIT_ESC;
 my $EXE_ST = ''; # pack('dd', st_ctime, st_size);
 my ($GIT_EXE, $GIT_VER);
 
-sub version {
-	check_git_exe();
-	$GIT_VER;
-}
-
 sub check_git_exe () {
 	$GIT_EXE = which('git') // die "git not found in $ENV{PATH}";
 	my @st = stat($GIT_EXE) or die "stat: $!";
@@ -72,6 +67,11 @@ sub check_git_exe () {
 	}
 }
 
+sub git_version {
+	check_git_exe();
+	$GIT_VER;
+}
+
 # unquote pathnames used by git, see quote.c::unquote_c_style.c in git.git
 sub git_unquote ($) {
 	return $_[0] unless ($_[0] =~ /\A"(.*)"\z/);
diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm
index 8f749688..bed034f1 100644
--- a/lib/PublicInbox/LeiMirror.pm
+++ b/lib/PublicInbox/LeiMirror.pm
@@ -276,7 +276,7 @@ sub fetch_args ($$) {
 			($lei->{opt}->{jobs} // 1) > 1;
 	push @cmd, '-v' if $lei->{opt}->{verbose};
 	push(@cmd, '-p') if $lei->{opt}->{prune};
-	PublicInbox::Git::version() ge v2.29.0 and
+	PublicInbox::Git::git_version() ge v2.29.0 and
 		push(@cmd, '--no-write-fetch-head');
 	@cmd;
 }
diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm
index aa2abc43..ddee58b1 100644
--- a/lib/PublicInbox/TestCommon.pm
+++ b/lib/PublicInbox/TestCommon.pm
@@ -111,7 +111,7 @@ sub have_xapian_compact (;$) {
 sub require_git ($;$) {
 	my ($req, $nr) = @_;
 	require PublicInbox::Git;
-	state $cur_vstr = PublicInbox::Git::version();
+	state $cur_vstr = PublicInbox::Git::git_version();
 	$req = eval("v$req") unless isvstring($req);
 
 	return 1 if $cur_vstr ge $req;

  parent reply	other threads:[~2023-04-12  0:13 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-12  0:12 [PATCH 0/5] various cleanups and tweaks Eric Wong
2023-04-12  0:12 ` [PATCH 1/5] git: cat_async_step: reduce batch-command info checks Eric Wong
2023-04-12  0:12 ` [PATCH 2/5] gzip_filter: use carp in ->bail for failure checks Eric Wong
2023-04-12  0:13 ` Eric Wong [this message]
2023-04-12  0:13 ` [PATCH 4/5] www_coderepo: drop unused $EACH_REF variable Eric Wong
2023-04-12  0:13 ` [PATCH 5/5] git: parallelize manifest_entry Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230412001302.685421-4-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).