mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-11 12:48:10 +03:00
Replace copy SHA with copy subject on commit 'y s'
This commit is contained in:
@ -146,6 +146,15 @@ func (self *CommitCommands) GetCommitMessage(commitSha string) (string, error) {
|
||||
return strings.TrimSpace(message), err
|
||||
}
|
||||
|
||||
func (self *CommitCommands) GetCommitSubject(commitSha string) (string, error) {
|
||||
cmdArgs := NewGitCmd("log").
|
||||
Arg("--format=%s", "--max-count=1", commitSha).
|
||||
ToArgv()
|
||||
|
||||
subject, err := self.cmd.New(cmdArgs).DontLog().RunWithOutput()
|
||||
return strings.TrimSpace(subject), err
|
||||
}
|
||||
|
||||
func (self *CommitCommands) GetCommitDiff(commitSha string) (string, error) {
|
||||
cmdArgs := NewGitCmd("show").Arg("--no-color", commitSha).ToArgv()
|
||||
|
||||
|
Reference in New Issue
Block a user