1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

Add integration test that accesses commit properties in a custom command

Useful as a regression test to check that the following commit doesn't break it.
This commit is contained in:
Stefan Haller
2024-04-11 18:38:20 +02:00
parent 28923fc9d0
commit e6a07b3f03
3 changed files with 46 additions and 0 deletions

View File

@ -55,3 +55,11 @@ func (self *Git) Version() *git_commands.GitVersion {
}
return version
}
func (self *Git) GetCommitHash(ref string) string {
output, err := self.shell.runCommandWithOutput([]string{"git", "rev-parse", ref})
if err != nil {
log.Fatalf("Could not get commit hash: %v", err)
}
return strings.TrimSpace(output)
}