git.cweiske.de
/
phorkie.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
customizable top bar
[phorkie.git]
/
src
/
phorkie
/
File.php
diff --git
a/src/phorkie/File.php
b/src/phorkie/File.php
index bc0950fce26f1c1d583649f2e6440b5b1b5db904..188c255918f8f0cbb44b983b4a94ac923f7ce274 100644
(file)
--- a/
src/phorkie/File.php
+++ b/
src/phorkie/File.php
@@
-61,7
+61,11
@@
class File
public function getContent()
{
if ($this->repo->hash) {
public function getContent()
{
if ($this->repo->hash) {
- return $this->repo->getVc()->getCommand('show')
+ //quick hack until https://pear.php.net/bugs/bug.php?id=19385 is fixed
+ $cmd = new GitCommandBinary($this->repo->getVc());
+ $cmd->setSubCommand('show');
+ return //$this->repo->getVc()->getCommand('show')
+ $cmd
->addArgument($this->repo->hash . ':' . $this->path)
->execute();
}
->addArgument($this->repo->hash . ':' . $this->path)
->execute();
}
@@
-102,7
+106,12
@@
class File
public function getLink($type, $option = null)
{
if ($type == 'raw') {
public function getLink($type, $option = null)
{
if ($type == 'raw') {
- return '/' . $this->repo->id . '/raw/' . $this->getFilename();
+ if ($this->repo->hash === null) {
+ return '/' . $this->repo->id . '/raw/' . $this->getFilename();
+ } else {
+ return '/' . $this->repo->id . '/rev-raw/' . $this->repo->hash
+ . '/' . $this->getFilename();
+ }
} else if ($type == 'tool') {
return '/' . $this->repo->id . '/tool/' . $option . '/' . $this->getFilename();
}
} else if ($type == 'tool') {
return '/' . $this->repo->id . '/tool/' . $option . '/' . $this->getFilename();
}