Merge branch 'fix-default-branch'
This commit is contained in:
commit
cec8ea9806
|
@ -29,7 +29,7 @@ func newRepositoryNode(project *gitlab.Project, param *FSParam) (*RepositoryNode
|
||||||
|
|
||||||
func (n *RepositoryNode) Readlink(ctx context.Context) ([]byte, syscall.Errno) {
|
func (n *RepositoryNode) Readlink(ctx context.Context) ([]byte, syscall.Errno) {
|
||||||
// Create the local copy of the repo
|
// Create the local copy of the repo
|
||||||
localRepoLoc, _ := n.param.Git.CloneOrPull(n.project.CloneURL, n.project.ID, "master")
|
localRepoLoc, _ := n.param.Git.CloneOrPull(n.project.CloneURL, n.project.ID, n.project.DefaultBranch)
|
||||||
|
|
||||||
return []byte(localRepoLoc), 0
|
return []byte(localRepoLoc), 0
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ type Project struct {
|
||||||
ID int
|
ID int
|
||||||
Name string
|
Name string
|
||||||
CloneURL string
|
CloneURL string
|
||||||
|
DefaultBranch string
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *gitlabClient) newProjectFromGitlabProject(project *gitlab.Project) Project {
|
func (c *gitlabClient) newProjectFromGitlabProject(project *gitlab.Project) Project {
|
||||||
|
@ -15,6 +16,10 @@ func (c *gitlabClient) newProjectFromGitlabProject(project *gitlab.Project) Proj
|
||||||
p := Project{
|
p := Project{
|
||||||
ID: project.ID,
|
ID: project.ID,
|
||||||
Name: project.Path,
|
Name: project.Path,
|
||||||
|
DefaultBranch: project.DefaultBranch,
|
||||||
|
}
|
||||||
|
if p.DefaultBranch == "" {
|
||||||
|
p.DefaultBranch = "master"
|
||||||
}
|
}
|
||||||
if c.PullMethod == PullMethodSSH {
|
if c.PullMethod == PullMethodSSH {
|
||||||
p.CloneURL = project.SSHURLToRepo
|
p.CloneURL = project.SSHURLToRepo
|
||||||
|
|
Loading…
Reference in New Issue