stable

Clone or download

Read-only

Display current ref while browsing a git repository

Part of story #10414: have a branch/tag selector This is a first step to be able to have a branch tag selector. In order to use this, you will need to add in your local.inc file the following variable: $git_repository_bp = 1; Browse the tree of a specific tag: name of the tag is displayed under the tabs. Browse the tree of a specific branch: name of the branch is displayed. Browse the tree of a random commit without any tag or branch: hash of the commit is displayed. Browse the tree of a git repository without any commit in the default branch (typically master): Undefined is displayed. If commit of the current tree has more than one ref, we display arbitrarily the first one, starting with branches. However, if user asked for a specific ref in the url (hb query parameter), then we will display that one instead, example: a1b2c3d4 --o---o---o---o master, dev, 10.5 If url: a=tree => displays 'master' If url: a=tree&hb=a1b2c3d4 => displays 'master' If url: a=tree&hb=refs/tags/10.5 => displays '10.5' If url: a=tree&hb=refs/heads/dev => displays 'dev' If url: a=tree&hb=dev => displays 'dev' PS: styling is temporary, tlp-badge will be replaced by a dropdown in a next commit. Change-Id: I438cd9b1707348b605a9e4940383097a3318c8bf

Modified Files

Name
M plugins/git/include/Git/GitRepositoryBrowserController.php +27 −12 Go to diff View file
A plugins/git/include/Git/Repository/View/CommitForCurrentTreeRetriever.php +51 −0 Go to diff View file
A plugins/git/include/Git/Repository/View/FilesHeaderPresenter.php +42 −0 Go to diff View file
A plugins/git/include/Git/Repository/View/FilesHeaderPresenterBuilder.php +94 −0 Go to diff View file
M plugins/git/include/gitPlugin.class.php +4 −1 Go to diff View file
A plugins/git/phpunit/Git/Repository/View/FilesHeaderPresenterBuilderTest.php +279 −0 Go to diff View file
M plugins/git/site-content/fr_FR/LC_MESSAGES/tuleap-git.po +3 −0 Go to diff View file
M plugins/git/site-content/tuleap-git.pot +3 −0 Go to diff View file
M plugins/git/templates/repository/files/header.mustache +9 −0 Go to diff View file