diff options
author | Luka Markušić <luka.markusic@microblink.com> | 2022-03-24 21:04:33 +0100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-26 17:22:42 +1100 |
commit | 540edb0bf46df2dce32f9bcc554c482cfa0cbc7b (patch) | |
tree | 290512e4a9c2b7dd61b9a4b0629861ed48b949ef /pkg/commands | |
parent | bbaa651943a4b699df4c359a699a677721fd923b (diff) |
Add copy commit attributes option
Diffstat (limited to 'pkg/commands')
-rw-r--r-- | pkg/commands/git_commands/commit.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pkg/commands/git_commands/commit.go b/pkg/commands/git_commands/commit.go index 75256878f..1e0a442f2 100644 --- a/pkg/commands/git_commands/commit.go +++ b/pkg/commands/git_commands/commit.go @@ -74,6 +74,12 @@ func (self *CommitCommands) GetCommitMessage(commitSha string) (string, error) { return strings.TrimSpace(message), err } +func (self *CommitCommands) GetCommitDiff(commitSha string) (string, error) { + cmdStr := "git show --no-color " + commitSha + diff, err := self.cmd.New(cmdStr).DontLog().RunWithOutput() + return diff, err +} + func (self *CommitCommands) GetCommitMessageFirstLine(sha string) (string, error) { return self.GetCommitMessagesFirstLine([]string{sha}) } |