MCPcopy Index your code
hub / github.com/jesseduffield/lazygit / GetCommitHash

Method GetCommitHash

pkg/integration/components/git.go:59–65  ·  view source on GitHub ↗
(ref string)

Source from the content-addressed store, hash-verified

57}
58
59func (self *Git) GetCommitHash(ref string) string {
60 output, err := self.shell.runCommandWithOutput([]string{"git", "rev-parse", ref})
61 if err != nil {
62 log.Fatalf("Could not get commit hash: %v", err)
63 }
64 return strings.TrimSpace(output)
65}

Calls 1

runCommandWithOutputMethod · 0.80

Tested by

no test coverage detected