From 5717e72366f2276b3cfc6f309108e19a21e2db20 Mon Sep 17 00:00:00 2001 From: Ryooooooga Date: Sat, 7 May 2022 18:06:51 +0900 Subject: [PATCH] fix: fix copying author name to clipboard --- pkg/commands/git_commands/commit.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/commands/git_commands/commit.go b/pkg/commands/git_commands/commit.go index 8d673ee2c..2422a2600 100644 --- a/pkg/commands/git_commands/commit.go +++ b/pkg/commands/git_commands/commit.go @@ -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") }