Add ShortRefName to Ref interface

This commit is contained in:
Stefan Haller 2024-08-28 15:33:12 +02:00
parent b07ce19b9a
commit ac335907ae
6 changed files with 21 additions and 0 deletions

View file

@ -70,6 +70,10 @@ func (c *Commit) RefName() string {
return c.Hash
}
func (c *Commit) ShortRefName() string {
return c.Hash[:7]
}
func (c *Commit) ParentRefName() string {
if c.IsFirstCommit() {
return EmptyTreeCommitHash