about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-04-21 11:52:03 +0000
committerEric Wong <e@80x24.org>2023-04-21 12:14:30 +0000
commitc23413abbe1db6e96af4a028f69613d1340e880c (patch)
tree7c028d366278631d7c14c9ca63f3d9cb8ea7eb43
parentc0af4b7e17b265c3c7d6d9c148488f49b18ea485 (diff)
downloadpublic-inbox-c23413abbe1db6e96af4a028f69613d1340e880c.tar.gz
Oops :x  I noticed this while I was working on a major optimization
for prune...
-rw-r--r--lib/PublicInbox/CodeSearchIdx.pm2
-rw-r--r--t/cindex.t2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/PublicInbox/CodeSearchIdx.pm b/lib/PublicInbox/CodeSearchIdx.pm
index 97123133..fa761ed0 100644
--- a/lib/PublicInbox/CodeSearchIdx.pm
+++ b/lib/PublicInbox/CodeSearchIdx.pm
@@ -803,7 +803,7 @@ EOM
                 my $f = "$git_dir/objects/info/alternates";
                 open $ALT_FH{$fmt}, '>', $f or die "open($f): $!";
         }
-        say { $ALT_FH{$fmt} } $out or die "say: $!";
+        say { $ALT_FH{$fmt} } $objdir or die "say: $!";
 }
 
 sub prep_alternate_start {
diff --git a/t/cindex.t b/t/cindex.t
index d40f73ff..8b89ebff 100644
--- a/t/cindex.t
+++ b/t/cindex.t
@@ -165,6 +165,8 @@ if ('--prune') {
         $csrch->reopen;
         is(scalar($csrch->mset('s:hi')->items), 0,
                 'hit stays pruned since GIT_DIR was previously pruned');
+        isnt(scalar($csrch->mset('s:NUL')->items), 0,
+                'prune did not clobber entire index');
 }
 
 File::Path::remove_tree("$tmp/ext");