]> Sergey Matveev's repositories - public-inbox.git/commitdiff
admin: resolve inboxes to absolute paths for index
authorEric Wong <e@80x24.org>
Tue, 22 Dec 2020 06:01:44 +0000 (06:01 +0000)
committerEric Wong <e@80x24.org>
Tue, 22 Dec 2020 22:56:03 +0000 (22:56 +0000)
Some of my ancient v1-only scripts called public-inbox-index
to operate on GIT_DIR:

GIT_DIR=/path/to/foo.git public-inbox-index

This change ensures they keep working, otherwise "." will be
passed to the --git-dir= switch of git(1) because that's the
default directory if no inboxes are specified on the
command-line.

Fixes: 9fcce78e40b0a7c6 ("script/public-inbox-*: favor caller-provided pathnames")
lib/PublicInbox/Admin.pm

index c972fb680a80da9b6ce5e9b0cf75c12a73fcf170..9a86d206908623dec2d45c097224cb85e2519315 100644 (file)
@@ -127,7 +127,7 @@ sub resolve_inboxes ($;$$) {
                for (my $i = 0; $i <= $#dirs; $i++) {
                        my $dir = $dirs[$i];
                        my @st = stat($dir) or die "stat($dir): $!\n";
-                       $dir = resolve_inboxdir($dir, \(my $ver));
+                       $dir = $dirs[$i] = resolve_inboxdir($dir, \(my $ver));
                        if ($ver >= $min_ver) {
                                $s2i{"$st[0]\0$st[1]"} //= $i;
                        } else {