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.

CommentFileSizeAuthor
#1 use-default-branch.patch689 bytesNiklas Fiekas
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Niklas Fiekas’s picture

FileSize
689 bytes
helmo’s picture

+++ 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.

Niklas Fiekas’s picture

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

helmo’s picture

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...

Niklas Fiekas’s picture

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.

  • Commit ddbfa44 on 6.x-1.x, 7.x-1.x-dev by helmo:
    Issue #1291674 by Niklas Fiekas: Added Use VersioncontrolGitRepository::...