From d39a8a440c9b5c59e1fa058467f64034f8974e0e Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 2 Feb 2016 04:00:08 +0000 Subject: www: support git cloning via dumb HTTP This is enabled by default, for now. Smart HTTP cloning support will be added later, but it will be optional since it can be highly CPU and memory intensive. --- public-inbox-mda | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'public-inbox-mda') diff --git a/public-inbox-mda b/public-inbox-mda index 73c4ae1c..24feeb81 100755 --- a/public-inbox-mda +++ b/public-inbox-mda @@ -62,7 +62,7 @@ if (PublicInbox::MDA->precheck($filter, $dst->{address}) && PublicInbox::MDA->author_info($msg); END { - search_index_sync($main_repo) if ($? == 0); + index_sync($main_repo) if ($? == 0); }; local $ENV{GIT_AUTHOR_NAME} = $name; @@ -98,8 +98,12 @@ sub do_spamc { return ($@ || $? || !defined($$out) || $$out eq '') ? 0 : 1; } -sub search_index_sync { +sub index_sync { my ($git_dir) = @_; + + # potentially user-visible, ignore errors: + system('git', "--git-dir=$git_dir", 'update-server-info'); + eval { require PublicInbox::SearchIdx; PublicInbox::SearchIdx->new($git_dir, 2)->index_sync; -- cgit v1.2.3-24-ge0c7