MCPcopy
hub / github.com/semaphoreui/semaphore / openRepository

Function openRepository

db_lib/GoGitClient.go:80–94  ·  view source on GitHub ↗
(r GitRepository, targetDir GitRepositoryDirType)

Source from the content-addressed store, hash-verified

78}
79
80func openRepository(r GitRepository, targetDir GitRepositoryDirType) (*git.Repository, error) {
81
82 var dir string
83
84 switch targetDir {
85 case GitRepositoryTmpPath:
86 dir = util.Config.GetProjectTmpDir(r.Repository.ProjectID)
87 case GitRepositoryFullPath:
88 dir = r.GetFullPath()
89 default:
90 panic("unknown Repository directory type")
91 }
92
93 return git.PlainOpen(dir)
94}
95
96func (c GoGitClient) Clone(r GitRepository) error {
97 r.Logger.Log("Cloning Repository " + r.Repository.GitURL)

Callers 5

PullMethod · 0.85
CheckoutMethod · 0.85
CanBePulledMethod · 0.85
GetLastCommitMessageMethod · 0.85
GetLastCommitHashMethod · 0.85

Calls 2

GetProjectTmpDirMethod · 0.80
GetFullPathMethod · 0.45

Tested by

no test coverage detected