dmitri.shuralyov.com/service/change/...

Remove invalid CL status check.

This check is now performed upstream in maintner,
so no need to do it here.

Follows https://golang.org/cl/107296.
Updates https://golang.org/issue/21984, https://golang.org/issue/22060, https://golang.org/issue/24875.
dmitshur committed 6 years ago commit b6b18ef35bbdcbe29fea63b432ed48694fa51ce2
Collapse all
maintner/maintner.go
@@ -34,11 +34,11 @@ func (s service) List(_ context.Context, repo string, opt change.ListOptions) ([
	if project == nil {
		return nil, os.ErrNotExist
	}
	var is []change.Change
	err := project.ForeachCLUnsorted(func(cl *maintner.GerritCL) error {
		if cl.Private || cl.Status == "" {
		if cl.Private {
			return nil
		}
		state := state(cl.Status)
		switch {
		case opt.Filter == change.FilterOpen && state != change.OpenState:
@@ -73,11 +73,11 @@ func (s service) Count(_ context.Context, repo string, opt change.ListOptions) (
	if project == nil {
		return 0, os.ErrNotExist
	}
	var count uint64
	err := project.ForeachCLUnsorted(func(cl *maintner.GerritCL) error {
		if cl.Private || cl.Status == "" {
		if cl.Private {
			return nil
		}
		state := state(cl.Status)
		switch {
		case opt.Filter == change.FilterOpen && state != change.OpenState:
@@ -97,11 +97,11 @@ func (s service) Get(_ context.Context, repo string, id uint64) (change.Change,
	project := s.c.Gerrit().Project(serverProject(repo))
	if project == nil {
		return change.Change{}, os.ErrNotExist
	}
	cl := project.CL(int32(id))
	if cl == nil || cl.Private || cl.Status == "" {
	if cl == nil || cl.Private {
		return change.Change{}, os.ErrNotExist
	}
	return change.Change{
		ID:           uint64(cl.Number),
		State:        state(cl.Status),
@@ -120,11 +120,11 @@ func (s service) ListTimeline(_ context.Context, repo string, id uint64, opt *ch
	project := s.c.Gerrit().Project(serverProject(repo))
	if project == nil {
		return nil, os.ErrNotExist
	}
	cl := project.CL(int32(id))
	if cl == nil || cl.Private || cl.Status == "" {
	if cl == nil || cl.Private {
		return nil, os.ErrNotExist
	}
	var timeline []interface{}
	timeline = append(timeline, change.Comment{ // CL description.
		ID:        "0",
@@ -214,11 +214,11 @@ func (s service) ListCommits(_ context.Context, repo string, id uint64) ([]chang
	project := s.c.Gerrit().Project(serverProject(repo))
	if project == nil {
		return nil, os.ErrNotExist
	}
	cl := project.CL(int32(id))
	if cl == nil || cl.Private || cl.Status == "" {
	if cl == nil || cl.Private {
		return nil, os.ErrNotExist
	}
	commits := make([]change.Commit, int(cl.Version))
	for n := int32(1); n <= cl.Version; n++ {
		c := cl.CommitAtVersion(n)
@@ -238,11 +238,11 @@ func (s service) GetDiff(_ context.Context, repo string, id uint64, opt *change.
	project := s.c.Gerrit().Project(serverProject(repo))
	if project == nil {
		return nil, os.ErrNotExist
	}
	cl := project.CL(int32(id))
	if cl == nil || cl.Private || cl.Status == "" {
	if cl == nil || cl.Private {
		return nil, os.ErrNotExist
	}
	var c *maintner.GitCommit
	switch opt {
	case nil: