]> Sergey Matveev's repositories - public-inbox.git/commitdiff
git_async_cat: don't use Gcf2 for temporary git dirs
authorEric Wong <e@80x24.org>
Mon, 12 Sep 2022 16:04:48 +0000 (16:04 +0000)
committerEric Wong <e@80x24.org>
Mon, 12 Sep 2022 17:09:05 +0000 (17:09 +0000)
We don't want to be holding references to temporary directories
longer than necessary, an Gcf is intended to be long-lived.

lib/PublicInbox/GitAsyncCat.pm

index c12c4ec2528f750043e57abf660967d34e49e147..b32c2fd3cab4b6c665df483378b01f42952102c6 100644 (file)
@@ -51,7 +51,8 @@ sub ibx_async_cat ($$$$) {
        # {topdir} means ExtSearch (likely [extindex "all"]) with potentially
        # 100K alternates.  git(1) has a proposed patch for 100K alternates:
        # <https://lore.kernel.org/git/20210624005806.12079-1-e@80x24.org/>
-       if (!defined($ibx->{topdir}) && ($GCF2C //= eval {
+       if (!defined($ibx->{topdir}) && !defined($git->{-tmp}) &&
+               ($GCF2C //= eval {
                require PublicInbox::Gcf2Client;
                PublicInbox::Gcf2Client::new();
        } // 0)) { # 0: do not retry if libgit2 or Inline::C are missing