Add copy commit attributes option

This commit is contained in:
Luka Markušić 2022-03-24 21:04:33 +01:00 committed by Jesse Duffield
parent bbaa651943
commit 540edb0bf4
8 changed files with 155 additions and 53 deletions

View file

@ -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})
}