summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorRyooooooga <eial5q265e5@gmail.com>2022-05-07 18:06:51 +0900
committerRyooooooga <eial5q265e5@gmail.com>2022-05-07 18:08:05 +0900
commit5717e72366f2276b3cfc6f309108e19a21e2db20 (patch)
tree41aa88010d0cd6410550e02e54eab0d3fe328ad3 /pkg/commands
parent5eefe5b5b1d81d334a54a2901a9e278d2516fda3 (diff)
fix: fix copying author name to clipboard
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/git_commands/commit.go4
1 files 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")
}