From 97b45ccc7ae2f721744bd7ee1f1cbaab9e6df790 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 22 May 2019 02:14:00 +0000 Subject: [PATCH] git: workaround old git-rev-parse(1) (--git-path) git < 2.5.0 was missing --git-path support. This means any users relying on some rare environment variables will need git 2.5.0+ --- lib/PublicInbox/Git.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index 236f70c1..a4daaa48 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -59,6 +59,11 @@ sub git_path ($$) { $self->{-git_path}->{$path} ||= do { local $/ = "\n"; chomp(my $str = $self->qx(qw(rev-parse --git-path), $path)); + + # git prior to 2.5.0 did not understand --git-path + if ($str eq "--git-path\n$path") { + $str = "$self->{git_dir}/$path"; + } $str; }; } -- 2.48.1