]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
git: rename `_active' sub to `cat_active'
authorEric Wong <e@80x24.org>
Wed, 14 Aug 2024 00:16:41 +0000 (00:16 +0000)
committerEric Wong <e@80x24.org>
Thu, 15 Aug 2024 08:29:03 +0000 (08:29 +0000)
Having an underscore prefix is confusing for a public
subroutine, and the `cat_' prefix makes it obvious it isn't
some other command.

lib/PublicInbox/Git.pm
lib/PublicInbox/LeiStore.pm

index 32c11a593da6cdd43f3e85fadb47709fcb79c2ad..dd0a14e91fa75fb8c58b534842a0a802688216c0 100644 (file)
@@ -457,7 +457,7 @@ sub date_parse {
        } $self->qx('rev-parse', map { "--since=$_" } @_);
 }
 
-sub _active ($) {
+sub cat_active ($) {
        scalar(@{gcf_inflight($_[0]) // []}) ||
                ($_[0]->{ck} && scalar(@{gcf_inflight($_[0]->{ck}) // []}))
 }
@@ -466,7 +466,7 @@ sub _active ($) {
 # both completely done by using this:
 sub async_wait_all ($) {
        my ($self) = @_;
-       while (_active($self)) {
+       while (cat_active($self)) {
                check_async_wait($self);
                cat_async_wait($self);
        }
@@ -475,7 +475,7 @@ sub async_wait_all ($) {
 # returns true if there are pending "git cat-file" processes
 sub cleanup {
        my ($self, $lazy) = @_;
-       ($lazy && _active($self)) and
+       ($lazy && cat_active($self)) and
                return $self->{epwatch} ? watch_async($self) : 1;
        local $in_cleanup = 1;
        async_wait_all($self);
index b2da2bc36f91d48b6340baab49102770b829671a..f9e8267bbff0adc112bd1abf148775f35093683b 100644 (file)
@@ -573,7 +573,7 @@ sub set_xvmd {
 
 sub check_done {
        my ($self) = @_;
-       $self->git->_active ?
+       $self->git->cat_active ?
                add_uniq_timer("$self-check_done", 5, \&check_done, $self) :
                done($self);
 }