Indefero

Indefero Commit Details


Date:2008-07-27 14:38:49 (16 years 4 months ago)
Author:Loic d'Anterroches
Branch:dev, develop, feature-issue_links, feature.better-home, feature.content-md5, feature.diff-whitespace, feature.download-md5, feature.issue-links, feature.issue-of-others, feature.issue-summary, feature.search-filter, feature.webrepos, feature.wiki-default-page, master, newdiff, release-1.1, release-1.2, release-1.3, svn
Commit:3dbae6272a9f239499038f069f6472dfceb5e73e
Parents: 8a0a35726cd82e3003675d8ba432efe68f7c4f74
Message:Added smooth handling of bad files and commits.

Now simply redirect to the root of the first available branch.
Changes:

File differences

src/IDF/Git.php
6666
6767
6868
69
70
71
7269
7370
7471
*/
public function filesAtCommit($commit='HEAD', $folder='')
{
if ('commit' != $this->testHash($commit)) {
throw new Exception(sprintf(__('Not a valid commit: %s.'), $commit));
}
// now we grab the info about this commit including its tree.
$co = $this->getCommit($commit);
if ($folder) {
src/IDF/Views/Source.php
5555
5656
5757
58
59
60
61
62
63
64
5865
5966
6067
......
7582
7683
7784
85
7886
87
88
89
90
91
92
93
7994
8095
81
96
97
98
99
100
101
102
82103
83104
84105
85106
86107
87108
88
89
109
90110
91111
92112
$git = new IDF_Git(Pluf::f('git_repository'));
$commit = $match[2];
$branches = $git->getBranches();
if ('commit' != $git->testHash($commit)) {
// Redirect to the first branch
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase',
array($request->project->shortname,
$branches[0]));
return new Pluf_HTTP_Response_Redirect($url);
}
$res = $git->filesAtCommit($commit);
$cobject = $git->getCommit($commit);
$tree_in = in_array($commit, $branches);
{
$title = sprintf('%s Git Source Tree', (string) $request->project);
$git = new IDF_Git(Pluf::f('git_repository'));
$branches = $git->getBranches();
$commit = $match[2];
if ('commit' != $git->testHash($commit)) {
// Redirect to the first branch
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase',
array($request->project->shortname,
$branches[0]));
return new Pluf_HTTP_Response_Redirect($url);
}
$request_file = $match[3];
$request_file_info = $git->getFileInfo($request_file, $commit);
if (!$request_file_info) throw new Pluf_HTTP_Error404();
if (!$request_file_info) {
// Redirect to the first branch
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::treeBase',
array($request->project->shortname,
$branches[0]));
return new Pluf_HTTP_Response_Redirect($url);
}
if ($request_file_info->type != 'tree') {
return new Pluf_HTTP_Response($git->getBlob($request_file_info->hash),
'application/octet-stream');
}
$bc = self::makeBreadCrumb($request->project, $commit, $request_file_info->file);
$page_title = $bc.' - '.$title;
$branches = $git->getBranches();
$cobject = $git->getCommit();
$cobject = $git->getCommit($commit);
$tree_in = in_array($commit, $branches);
$res = $git->filesAtCommit($commit, $request_file);
// try to find the previous level if it exists.

Archive Download the corresponding diff file

Page rendered in 0.07698s using 13 queries.