about summary refs log tree commit diff
path: root/gerrit/changeset.go
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2019-12-03T09·16+0100
committerFlorian Klink <flokli@flokli.de>2019-12-03T09·16+0100
commit5acc403e28c8aeaef7583995c1e7cd6332111973 (patch)
treefb65b039b1ca41a35a0b439eea1fa0d4863e50c9 /gerrit/changeset.go
parent0e8aa14045ea9873e7b4aa7aadb1d4da2e54193a (diff)
changeset: fetch SUBMITTABLE and add field to struct
Diffstat (limited to 'gerrit/changeset.go')
-rw-r--r--gerrit/changeset.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/gerrit/changeset.go b/gerrit/changeset.go
index 71310a712514..0a0a607cd611 100644
--- a/gerrit/changeset.go
+++ b/gerrit/changeset.go
@@ -16,6 +16,7 @@ type Changeset struct {
 	Number          int
 	Verified        int
 	CodeReviewed    int
+	Submittable     bool
 	HashTags        []string
 	CommitID        string
 	ParentCommitIDs []string
@@ -31,6 +32,7 @@ func MakeChangeset(changeInfo *goGerrit.ChangeInfo) *Changeset {
 		Number:          changeInfo.Number,
 		Verified:        labelInfoToInt(changeInfo.Labels["Verified"]),
 		CodeReviewed:    labelInfoToInt(changeInfo.Labels["Code-Review"]),
+		Submittable:     changeInfo.Submittable,
 		HashTags:        changeInfo.Hashtags,
 		CommitID:        changeInfo.CurrentRevision, // yes, this IS the commit ID.
 		ParentCommitIDs: getParentCommitIDs(changeInfo),
@@ -65,7 +67,8 @@ func (c *Changeset) IsCodeReviewed() bool {
 func (c *Changeset) String() string {
 	var b bytes.Buffer
 	b.WriteString("Changeset")
-	b.WriteString(fmt.Sprintf("(commitID: %.7s, author: %s, subject: %s)", c.CommitID, c.OwnerName, c.Subject))
+	b.WriteString(fmt.Sprintf("(commitID: %.7s, author: %s, subject: %s, submittable: %v)",
+		c.CommitID, c.OwnerName, c.Subject, c.Submittable))
 	return b.String()
 }