From 5fcdd26007a699e3eeee066d87aa879de51466a9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 30 Apr 2014 00:14:35 +0000 Subject: feed: unset GIT_DIR and use "git --git-dir=.. log" This should elimate all of our %ENV dependencies in the WWW portion of our code. --- lib/PublicInbox/Feed.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index ad058395..d535cea9 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -23,7 +23,6 @@ sub generate { require POSIX; my $max = $args->{max} || MAX_PER_PAGE; - local $ENV{GIT_DIR} = $args->{git_dir}; my $feed_opts = get_feedopts($args); my $addr = $feed_opts->{address}; $addr = $addr->[0] if ref($addr); @@ -52,7 +51,6 @@ sub generate_html_index { require Mail::Thread; my $max = $args->{max} || MAX_PER_PAGE; - local $ENV{GIT_DIR} = $args->{git_dir}; my $feed_opts = get_feedopts($args); my $title = $feed_opts->{description} || ''; @@ -130,7 +128,8 @@ sub each_recent_blob { # get recent messages # we could use git log -z, but, we already know ssoma will not # leave us with filenames with spaces in them.. - my @cmd = qw/git log --no-notes --no-color --raw -r/; + my @cmd = ('git', "--git-dir=$args->{git_dir}", + qw/log --no-notes --no-color --raw -r/); push @cmd, $range; my $pid = open(my $log, '-|', @cmd) or -- cgit v1.2.3-24-ge0c7