]> Sergey Matveev's repositories - public-inbox.git/commitdiff
public-inbox-init: use absolute path
authorEric Wong <e@80x24.org>
Sun, 6 Sep 2015 07:15:26 +0000 (07:15 +0000)
committerEric Wong <e@80x24.org>
Sun, 6 Sep 2015 09:26:31 +0000 (09:26 +0000)
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

index 8847eb68fdf0a1384448a5de77404cda55f0a315..d6a63822a3980ffcfad5519fd7ce62a9ca88e491 100755 (executable)
@@ -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)};