Added a control to avoid redirecting to an inexisting branch.
This commit is contained in:
parent
e513d95dbe
commit
743a3f312c
@ -64,6 +64,12 @@ class IDF_Views_Source
|
|||||||
$branches = $scm->getBranches();
|
$branches = $scm->getBranches();
|
||||||
$commit = $match[2];
|
$commit = $match[2];
|
||||||
if ('commit' != $scm->testHash($commit)) {
|
if ('commit' != $scm->testHash($commit)) {
|
||||||
|
if (count($branches) == 0) {
|
||||||
|
// Redirect to the project source help
|
||||||
|
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::help',
|
||||||
|
array($request->project->shortname));
|
||||||
|
return new Pluf_HTTP_Response_Redirect($url);
|
||||||
|
}
|
||||||
// Redirect to the first branch
|
// Redirect to the first branch
|
||||||
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::changeLog',
|
$url = Pluf_HTTP_URL_urlForView('IDF_Views_Source::changeLog',
|
||||||
array($request->project->shortname,
|
array($request->project->shortname,
|
||||||
|
Loading…
Reference in New Issue
Block a user