Differential D8194 Diff 18543 src/applications/diffusion/controller/DiffusionBrowseFileController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/controller/DiffusionBrowseFileController.php
| Show First 20 Lines • Show All 885 Lines • ▼ Show 20 Lines | private function buildBeforeResponse($before) { | ||||
| if ($was_created) { | if ($was_created) { | ||||
| // If the file was created in history, that means older commits won't | // If the file was created in history, that means older commits won't | ||||
| // have it. Since we know it existed at 'before', it must have been | // have it. Since we know it existed at 'before', it must have been | ||||
| // created then; jump there. | // created then; jump there. | ||||
| $target_commit = $before; | $target_commit = $before; | ||||
| $follow = 'created'; | $follow = 'created'; | ||||
| } else if ($parent) { | } else if ($parent) { | ||||
| // If we found a parent, jump to it. This is the normal case. | // If we found a parent, jump to it. This is the normal case. | ||||
| $target_commit = $parent->getCommitIdentifier(); | $target_commit = $parent; | ||||
| } else { | } else { | ||||
| // If there's no parent, this was probably created in the initial commit? | // If there's no parent, this was probably created in the initial commit? | ||||
| // And the "was_created" check will fail because we can't identify the | // And the "was_created" check will fail because we can't identify the | ||||
| // grandparent. Keep the user at 'before'. | // grandparent. Keep the user at 'before'. | ||||
| $target_commit = $before; | $target_commit = $before; | ||||
| $follow = 'first'; | $follow = 'first'; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 118 Lines • Show Last 20 Lines | |||||