mirror of
https://github.com/semaphoreui/semaphore.git
synced 2024-11-23 12:30:41 +01:00
feat: use go git client by default
This commit is contained in:
parent
6754025fa0
commit
d8b7cc54ba
13
lib/GitClientFactory.go
Normal file
13
lib/GitClientFactory.go
Normal file
@ -0,0 +1,13 @@
|
||||
package lib
|
||||
|
||||
func CreateDefaultGitClient() GitClient {
|
||||
return CreateGoGitClient()
|
||||
}
|
||||
|
||||
func CreateGoGitClient() GitClient {
|
||||
return GoGitClient{}
|
||||
}
|
||||
|
||||
func CreateCmdGitClient() GitClient {
|
||||
return CmdGitClient{}
|
||||
}
|
@ -31,7 +31,7 @@ func (r ScheduleRunner) tryUpdateScheduleCommitHash(schedule db.Schedule) (updat
|
||||
Logger: nil,
|
||||
TemplateID: schedule.TemplateID,
|
||||
Repository: repo,
|
||||
Client: lib.GoGitClient{},
|
||||
Client: lib.CreateDefaultGitClient(),
|
||||
}.GetLastRemoteCommitHash()
|
||||
|
||||
if err != nil {
|
||||
|
@ -60,7 +60,7 @@ func (t *TaskRunner) getRepoPath() string {
|
||||
Logger: t,
|
||||
TemplateID: t.template.ID,
|
||||
Repository: t.repository,
|
||||
Client: lib.GoGitClient{},
|
||||
Client: lib.CreateDefaultGitClient(),
|
||||
}
|
||||
|
||||
return repo.GetFullPath()
|
||||
@ -439,7 +439,7 @@ func (t *TaskRunner) checkoutRepository() error {
|
||||
Logger: t,
|
||||
TemplateID: t.template.ID,
|
||||
Repository: t.repository,
|
||||
Client: lib.GoGitClient{},
|
||||
Client: lib.CreateDefaultGitClient(),
|
||||
}
|
||||
|
||||
err := repo.ValidateRepo()
|
||||
@ -474,7 +474,7 @@ func (t *TaskRunner) updateRepository() error {
|
||||
Logger: t,
|
||||
TemplateID: t.template.ID,
|
||||
Repository: t.repository,
|
||||
Client: lib.GoGitClient{},
|
||||
Client: lib.CreateDefaultGitClient(),
|
||||
}
|
||||
|
||||
err := repo.ValidateRepo()
|
||||
|
Loading…
Reference in New Issue
Block a user