From 7bcef03ec70e6a128c608b029bdfbf3ca7ae87db Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 29 Sep 2018 11:35:47 +0200 Subject: httpdocs/index.php: serve hg tar balls --- httpdocs/index.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/httpdocs/index.php b/httpdocs/index.php index b519fe3..941fee9 100644 --- a/httpdocs/index.php +++ b/httpdocs/index.php @@ -87,10 +87,23 @@ if (isset($_GET['r'])) { } if ($_GET['t']=='git') $handle = popen( - 'git -C "../work/repositories/' . $_GET['t'] . '/' . $_GET['r'] . '" archive' . $prefix . ' "' . $commit_identifier . '" | ' . + 'git -C "' . $wok_dir . 'repositories/' . $_GET['t'] . '/' . $_GET['r'] . '"' . + ' archive' . + $prefix . + ' "' . $commit_identifier . '" | ' . 'gzip -nc', 'r' ); + elseif ($_GET['t']=='hg') + $handle = popen( + 'hg archive' . + ' -t tgz' . + $prefix . + ' -R "' . $work_dir . 'repositories/' . $_GET['t'] . '/' . $_GET['r'] . '"' . + ' -r "' . $commit_identifier . '"' . + ' /dev/stdout', + 'r' + ); else $handle = false; if ($handle === false) -- cgit v1.2.3