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

Method Checkout

db_lib/GoGitClient.go:151–170  ·  view source on GitHub ↗
(r GitRepository, target string)

Source from the content-addressed store, hash-verified

149}
150
151func (c GoGitClient) Checkout(r GitRepository, target string) error {
152 r.Logger.Log("Checkout repository to " + target)
153
154 rep, err := openRepository(r, GitRepositoryFullPath)
155 if err != nil {
156 return err
157 }
158
159 wt, err := rep.Worktree()
160
161 if err != nil {
162 return err
163 }
164
165 err = wt.Checkout(&git.CheckoutOptions{
166 Hash: plumbing.NewHash(target),
167 })
168
169 return err
170}
171
172func (c GoGitClient) CanBePulled(r GitRepository) bool {
173

Callers

nothing calls this directly

Calls 3

openRepositoryFunction · 0.85
LogMethod · 0.65
CheckoutMethod · 0.65

Tested by

no test coverage detected