1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-04 10:34:55 +02:00

fix: fix copying author name to clipboard

This commit is contained in:
Ryooooooga 2022-05-07 18:06:51 +09:00
parent 5eefe5b5b1
commit 5717e72366
No known key found for this signature in database
GPG Key ID: 07CF200DFCC20C25

View File

@ -87,13 +87,13 @@ type Author struct {
}
func (self *CommitCommands) GetCommitAuthor(commitSha string) (Author, error) {
cmdStr := "git show --no-patch --pretty=format:'%an|%ae' " + commitSha
cmdStr := "git show --no-patch --pretty=format:'%an%x00%ae' " + commitSha
output, err := self.cmd.New(cmdStr).DontLog().RunWithOutput()
if err != nil {
return Author{}, err
}
split := strings.Split(strings.TrimSpace(output), "|")
split := strings.SplitN(strings.TrimSpace(output), "\x00", 2)
if len(split) < 2 {
return Author{}, errors.New("unexpected git output")
}