stable

Clone or download

Read-only

Set default branch of Git repositories to main

This is mainly a technical change since Tuleap, as of today, only creates empty repositories so when users clone it for the first time their local config of init.defaultBranch has priority. However this change makes us future proof: * we now have the possibility to explicitly choose the default branch name which can be interesting if we want to init repositories with some content * it makes sure we will not be surprised by future changes in Git * it allows us to remove the usage of the term "master" in some of the tests To test you can create a new repository and check the result of `git symbolic-ref HEAD` in the newly created reprository. Part of request #13356: Allow to change the default branch Change-Id: Ia97299aa3c0e195fda7527797a24c622893870a6

Modified Files

Name
A plugins/git/include/Branch/BranchName.php +60 −0 Go to diff View file
A plugins/git/include/Branch/InvalidBranchNameException.php +34 −0 Go to diff View file
M plugins/git/include/Git/CreateRepositoryController.php +6 −1 Go to diff View file
M plugins/git/include/Git/Repository/RepositoryCreator.php +3 −3 Go to diff View file
M plugins/git/include/Git/SystemEventManager.class.php +7 −2 Go to diff View file
M plugins/git/include/GitRepositoryManager.class.php +3 −2 Go to diff View file
M plugins/git/include/GitXmlImporter.class.php +2 −1 Go to diff View file
M plugins/git/include/Git_Exec.class.php +7 −1 Go to diff View file
M plugins/git/include/SystemEvents/SystemEvent_GIT_REPO_UPDATE.class.php +41 −6 Go to diff View file
A plugins/git/tests/unit/Branch/BranchNameTest.php +47 −0 Go to diff View file
M plugins/git/tests/unit/GitRepositoryManagerCreateTest.php +8 −9 Go to diff View file
M plugins/git/tests/unit/Git_ExecTest.php +4 −4 Go to diff View file
M plugins/pullrequest/tests/unit/GitExecTest.php +7 −7 Go to diff View file