1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00

Support both Sha and Hash on commits in custom commands

We achieve this by wrapping the model Commit in a custom struct that provides
both.
This commit is contained in:
Stefan Haller
2024-04-11 18:39:21 +02:00
parent e6a07b3f03
commit 7e14d88dc9
2 changed files with 45 additions and 8 deletions

View File

@ -19,7 +19,7 @@ var AccessCommitProperties = NewIntegrationTest(NewIntegrationTestArgs{
{
Key: "X",
Context: "commits",
Command: "printf '%s\n%s' '{{ .SelectedLocalCommit.Name }}' '{{ .SelectedLocalCommit.Hash }}' > file.txt",
Command: "printf '%s\n%s\n%s' '{{ .SelectedLocalCommit.Name }}' '{{ .SelectedLocalCommit.Hash }}' '{{ .SelectedLocalCommit.Sha }}' > file.txt",
},
}
},
@ -32,6 +32,6 @@ var AccessCommitProperties = NewIntegrationTest(NewIntegrationTestArgs{
Press("X")
hash := t.Git().GetCommitHash("HEAD")
t.FileSystem().FileContent("file.txt", Equals(fmt.Sprintf("my change\n%s", hash)))
t.FileSystem().FileContent("file.txt", Equals(fmt.Sprintf("my change\n%s\n%s", hash, hash)))
},
})