This is the second step to solve #1074960: Let maintainers set a default branch on git repositories. Once #1291308: Add setDefaultBranch() and getDefaultBranch() method to VersioncontrolGitRepository is comitted and VersioncontrolGitRepository has getters and setters for the default branch, the attached patch can go into Project Git Instructions.

Please review.

Files: 
CommentFileSizeAuthor
#1 use-default-branch.patch689 bytesNiklas Fiekas

Comments

StatusFileSize
new689 bytes

+++ b/project_git_instructions.module
@@ -161,6 +161,9 @@ function project_git_instructions_project_tab($node, $version = NULL, $do_nonmai
   if (empty($version) && !empty($versions)) {
     $version = current($versions);
   }

This next bit might go in an elseif,
And we could add a comment line like "// Get default branch name if no version was selected"

But looks ok otherwise.

Thank you for reviewing. I wouldn't use elseif because getDefaultBranch() could be emtpy, too.

Status:Needs review» Fixed

I've committed this as http://drupalcode.org/project/project_git_instructions.git/commit/ddbfa44

Hopefully that make's it easier to test the integration...

Thanks helmo. Though it's not yet in versioncontrol_git I don't think the API will change, so that's great.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.