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

Method GetLastCommitHash

db_lib/GoGitClient.go:240–254  ·  view source on GitHub ↗
(r GitRepository)

Source from the content-addressed store, hash-verified

238}
239
240func (c GoGitClient) GetLastCommitHash(r GitRepository) (hash string, err error) {
241 r.Logger.Log("Get current commit hash")
242
243 rep, err := openRepository(r, GitRepositoryFullPath)
244 if err != nil {
245 return
246 }
247
248 headRef, err := rep.Head()
249 if err != nil {
250 return
251 }
252 hash = headRef.Hash().String()
253 return
254}
255
256func (c GoGitClient) GetLastRemoteCommitHash(r GitRepository) (hash string, err error) {
257

Callers

nothing calls this directly

Calls 3

openRepositoryFunction · 0.85
LogMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected