diff --git a/src/IDF/Scm/Git.php b/src/IDF/Scm/Git.php index 3f75b95..6e2451a 100644 --- a/src/IDF/Scm/Git.php +++ b/src/IDF/Scm/Git.php @@ -203,14 +203,15 @@ class IDF_Scm_Git /** * Get a blob. * - * @param string Blob hash + * @param string request_file_info + * @param null to be svn client compatible * @return string Raw blob */ - public function getBlob($hash) + public function getBlob($request_file_info, $dummy=null) { return shell_exec(sprintf('GIT_DIR=%s git-cat-file blob %s', escapeshellarg($this->repo), - escapeshellarg($hash))); + escapeshellarg($request_file_info->hash))); } /** diff --git a/src/IDF/Scm/Svn.php b/src/IDF/Scm/Svn.php index 371834f..4197602 100644 --- a/src/IDF/Scm/Svn.php +++ b/src/IDF/Scm/Svn.php @@ -228,15 +228,15 @@ class IDF_Scm_Svn /** * Get a blob. * - * @param string Blob hash + * @param string request_file_info * @return string Raw blob */ - public function getBlob($path, $rev) + public function getBlob($request_file_info, $rev) { $cmd = sprintf('svn cat --username=%s --password=%s %s@%s', escapeshellarg($this->username), escapeshellarg($this->password), - escapeshellarg($this->repo.'/'.$path), + escapeshellarg($this->repo.'/'.$request_file_info->fullpath), escapeshellarg($rev)); return shell_exec($cmd); } diff --git a/src/IDF/Views/Source.php b/src/IDF/Views/Source.php index 04e6a6a..bfdbf9e 100644 --- a/src/IDF/Views/Source.php +++ b/src/IDF/Views/Source.php @@ -124,7 +124,7 @@ class IDF_Views_Source } if ($request_file_info->type != 'tree') { $info = self::getMimeType($request_file_info->file); - $rep = new Pluf_HTTP_Response($scm->getBlob($request_file_info->hash), + $rep = new Pluf_HTTP_Response($scm->getBlob($request_file_info, $commit), $info[0]); $rep->headers['Content-Disposition'] = 'attachment; filename="'.$info[1].'"'; return $rep;