summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--httpdocs/index.php15
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)