Browse files

fs: Use fromClose to populate event.Close field.

issues.Event.Close field is documented to be specified for Closed
events, so actually do populate it for Closed events.

This change is a no-op because the encoded closeDisk representation
of issues.Close{Closer: nil} happens to be nil *closeDisk, which is
the zero value.

But we should be doing this in case it ever becomes something else,
and so that fromClose isn't detected as unused.

fromClose will come in more handy when there are ways to close issues
via commits or changes.

Updates 53080de.
  • Loading branch information...
dmitshur committed Oct 8, 2018
1 parent e7213ea commit 449140e4801ea85fd5339e9aeb0dc44874269ba6
Showing with 1 addition and 0 deletions.
  1. +1 −0 fs/fs.go
@@ -531,6 +531,7 @@ func (s *service) Edit(ctx context.Context, repo issues.RepoSpec, id uint64, ir
event.Type = issues.Reopened
case issues.ClosedState:
event.Type = issues.Closed
event.Close = fromClose(issues.Close{Closer: nil})
case ir.Title != nil && *ir.Title != origTitle:
event.Type = issues.Renamed

0 comments on commit 449140e

Please sign in to comment.