diff options
author | Ryooooooga <eial5q265e5@gmail.com> | 2022-03-26 22:18:08 +0900 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-04-02 17:04:42 +1100 |
commit | 4835fc00b861c6117c1d4d6873a05d808e54b4cf (patch) | |
tree | 6f521eb16da8c9310cab776d6b57e84de32d4752 /pkg/commands/models | |
parent | 30be50b641dbe594d7968e79536028f22beee1b0 (diff) |
introduce Ref interface
Diffstat (limited to 'pkg/commands/models')
-rw-r--r-- | pkg/commands/models/branch.go | 4 | ||||
-rw-r--r-- | pkg/commands/models/remote_branch.go | 4 | ||||
-rw-r--r-- | pkg/commands/models/stash_entry.go | 4 | ||||
-rw-r--r-- | pkg/commands/models/tag.go | 4 |
4 files changed, 16 insertions, 0 deletions
diff --git a/pkg/commands/models/branch.go b/pkg/commands/models/branch.go index dae934fdf..b41e157f3 100644 --- a/pkg/commands/models/branch.go +++ b/pkg/commands/models/branch.go @@ -22,6 +22,10 @@ func (b *Branch) RefName() string { return b.Name } +func (b *Branch) ParentRefName() string { + return b.RefName() + "^" +} + func (b *Branch) ID() string { return b.RefName() } diff --git a/pkg/commands/models/remote_branch.go b/pkg/commands/models/remote_branch.go index bee004fdb..e36592749 100644 --- a/pkg/commands/models/remote_branch.go +++ b/pkg/commands/models/remote_branch.go @@ -14,6 +14,10 @@ func (r *RemoteBranch) RefName() string { return r.FullName() } +func (r *RemoteBranch) ParentRefName() string { + return r.RefName() + "^" +} + func (r *RemoteBranch) ID() string { return r.RefName() } diff --git a/pkg/commands/models/stash_entry.go b/pkg/commands/models/stash_entry.go index efda6bc77..d15bfd2eb 100644 --- a/pkg/commands/models/stash_entry.go +++ b/pkg/commands/models/stash_entry.go @@ -12,6 +12,10 @@ func (s *StashEntry) RefName() string { return fmt.Sprintf("stash@{%d}", s.Index) } +func (s *StashEntry) ParentRefName() string { + return s.RefName() + "^" +} + func (s *StashEntry) ID() string { return s.RefName() } diff --git a/pkg/commands/models/tag.go b/pkg/commands/models/tag.go index 2fb024e66..60b53e659 100644 --- a/pkg/commands/models/tag.go +++ b/pkg/commands/models/tag.go @@ -9,6 +9,10 @@ func (t *Tag) RefName() string { return t.Name } +func (t *Tag) ParentRefName() string { + return t.RefName() + "^" +} + func (t *Tag) ID() string { return t.RefName() } |