diff options
author | Erich Eckner <git@eckner.net> | 2018-09-29 11:35:47 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-09-29 11:35:47 +0200 |
commit | 7bcef03ec70e6a128c608b029bdfbf3ca7ae87db (patch) | |
tree | b0907bcb012c89e7e25652b29bee3098eec2722b /httpdocs/index.php | |
parent | 497ce6bb79ba1133db166f2bf1bc9e4daff05286 (diff) | |
download | archive-server-7bcef03ec70e6a128c608b029bdfbf3ca7ae87db.tar.xz |
httpdocs/index.php: serve hg tar balls
Diffstat (limited to 'httpdocs/index.php')
-rw-r--r-- | httpdocs/index.php | 15 |
1 files changed, 14 insertions, 1 deletions
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) |