summaryrefslogtreecommitdiffstats
path: root/pkg/commands
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-08-22 10:14:53 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-08-23 14:29:18 +1000
commit8da93fd76287d16156308896ef162e9749fcd27f (patch)
treef1b9222ae61881e0be7c9df644ee21a91f004e3f /pkg/commands
parent63209ef71e3de50cce815b5982fec5f659f2eb74 (diff)
add description field to ListItem interface
Diffstat (limited to 'pkg/commands')
-rw-r--r--pkg/commands/branch.go4
-rw-r--r--pkg/commands/commit.go8
-rw-r--r--pkg/commands/commit_file.go4
-rw-r--r--pkg/commands/file.go4
-rw-r--r--pkg/commands/remote.go4
-rw-r--r--pkg/commands/remote_branch.go4
-rw-r--r--pkg/commands/stash_entry.go4
-rw-r--r--pkg/commands/tag.go4
8 files changed, 32 insertions, 4 deletions
diff --git a/pkg/commands/branch.go b/pkg/commands/branch.go
index b182b8b6d..321101755 100644
--- a/pkg/commands/branch.go
+++ b/pkg/commands/branch.go
@@ -20,3 +20,7 @@ func (b *Branch) RefName() string {
func (b *Branch) ID() string {
return b.RefName()
}
+
+func (b *Branch) Description() string {
+ return b.RefName()
+}
diff --git a/pkg/commands/commit.go b/pkg/commands/commit.go
index c0483f3f0..1e3a410c2 100644
--- a/pkg/commands/commit.go
+++ b/pkg/commands/commit.go
@@ -21,10 +21,6 @@ func (c *Commit) ShortSha() string {
return c.Sha[:8]
}
-func (c *Commit) NameWithSha() string {
- return fmt.Sprintf("%s %s", c.Sha[:7], c.Name)
-}
-
func (c *Commit) RefName() string {
return c.Sha
}
@@ -32,3 +28,7 @@ func (c *Commit) RefName() string {
func (c *Commit) ID() string {
return c.RefName()
}
+
+func (c *Commit) Description() string {
+ return fmt.Sprintf("%s %s", c.Sha[:7], c.Name)
+}
diff --git a/pkg/commands/commit_file.go b/pkg/commands/commit_file.go
index 2b231e079..4e632f07a 100644
--- a/pkg/commands/commit_file.go
+++ b/pkg/commands/commit_file.go
@@ -11,3 +11,7 @@ type CommitFile struct {
func (f *CommitFile) ID() string {
return f.Name
}
+
+func (f *CommitFile) Description() string {
+ return f.Name
+}
diff --git a/pkg/commands/file.go b/pkg/commands/file.go
index 12f63c9db..774e47fd7 100644
--- a/pkg/commands/file.go
+++ b/pkg/commands/file.go
@@ -40,3 +40,7 @@ func (f *File) Matches(f2 *File) bool {
func (f *File) ID() string {
return f.Name
}
+
+func (f *File) Description() string {
+ return f.Name
+}
diff --git a/pkg/commands/remote.go b/pkg/commands/remote.go
index 17ed8c1ca..1ce12963e 100644
--- a/pkg/commands/remote.go
+++ b/pkg/commands/remote.go
@@ -14,3 +14,7 @@ func (r *Remote) RefName() string {
func (r *Remote) ID() string {
return r.RefName()
}
+
+func (r *Remote) Description() string {
+ return r.RefName()
+}
diff --git a/pkg/commands/remote_branch.go b/pkg/commands/remote_branch.go
index 656546815..36199e46f 100644
--- a/pkg/commands/remote_branch.go
+++ b/pkg/commands/remote_branch.go
@@ -17,3 +17,7 @@ func (r *RemoteBranch) RefName() string {
func (r *RemoteBranch) ID() string {
return r.RefName()
}
+
+func (r *RemoteBranch) Description() string {
+ return r.RefName()
+}
diff --git a/pkg/commands/stash_entry.go b/pkg/commands/stash_entry.go
index 487da0f00..bdb899a75 100644
--- a/pkg/commands/stash_entry.go
+++ b/pkg/commands/stash_entry.go
@@ -15,3 +15,7 @@ func (s *StashEntry) RefName() string {
func (s *StashEntry) ID() string {
return s.RefName()
}
+
+func (s *StashEntry) Description() string {
+ return s.RefName() + ": " + s.Name
+}
diff --git a/pkg/commands/tag.go b/pkg/commands/tag.go
index 2009472b2..a51c9660a 100644
--- a/pkg/commands/tag.go
+++ b/pkg/commands/tag.go
@@ -12,3 +12,7 @@ func (t *Tag) RefName() string {
func (t *Tag) ID() string {
return t.RefName()
}
+
+func (t *Tag) Description() string {
+ return "tag " + t.Name
+}