summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorLuka Markušić <luka.markusic@microblink.com>2022-03-24 21:04:33 +0100
committerJesse Duffield <jessedduffield@gmail.com>2022-03-26 17:22:42 +1100
commit540edb0bf46df2dce32f9bcc554c482cfa0cbc7b (patch)
tree290512e4a9c2b7dd61b9a4b0629861ed48b949ef /pkg/commands
parentbbaa651943a4b699df4c359a699a677721fd923b (diff)
Add copy commit attributes option
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/git_commands/commit.go6
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})
}