We actually have no business expanding (e.g. translating ~ to
$HOME) paths from the command-line argument, the shell does
that.

However, we need to make the path absolute instead.
---
 public-inbox-init | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/public-inbox-init b/public-inbox-init
index 2d24402..a8f1dd7 100755
--- a/public-inbox-init
+++ b/public-inbox-init
@@ -8,7 +8,7 @@ use PublicInbox::Config;
 use File::Temp qw/tempfile/;
 use File::Basename qw/dirname/;
 use File::Path qw/mkpath/;
-use File::Path::Expand qw/expand_filename/;
+use Cwd qw/abs_path/;
 
 sub x { system(@_) and die join(' ', @_). " failed: $?\n" }
 sub usage { print STDERR "Usage: $usage\n"; exit 1 }
@@ -59,7 +59,7 @@ close $fh or die "failed to close $filename: $!\n";
 
 my $pfx = "publicinbox.$name";
 my @x = (qw/git config/, "--file=$filename");
-$git_dir = expand_filename($git_dir);
+$git_dir = abs_path($git_dir);
 x(qw(git init -q --bare), $git_dir);
 foreach my $addr (@address) {
        next if $seen{lc($addr)};
-- 
EW

--
unsubscribe: meta+unsubscr...@public-inbox.org
archive: http://public-inbox.org/meta/

Reply via email to