diff options
author | Alexander Scharinger <rng.dynamics@gmail.com> | 2021-04-08 23:17:24 +0200 |
---|---|---|
committer | Alexander Scharinger <rng.dynamics@gmail.com> | 2021-04-08 23:20:05 +0200 |
commit | ede5e218ac4ae492f06be9d3bb8a1e9463eda739 (patch) | |
tree | b0ebda8652d852076b54ea47b8c760088227c9bd /bridge/github/import.go | |
parent | 3d14e2e67c4985c429471ea6643f013ade2c2692 (diff) | |
download | git-bug-ede5e218ac4ae492f06be9d3bb8a1e9463eda739.tar.gz |
Add comment to clarify look ahead in import channel
Diffstat (limited to 'bridge/github/import.go')
-rw-r--r-- | bridge/github/import.go | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bridge/github/import.go b/bridge/github/import.go index 619c1c1e..66710d0f 100644 --- a/bridge/github/import.go +++ b/bridge/github/import.go @@ -59,7 +59,16 @@ func (gi *githubImporter) ImportAll(ctx context.Context, repo *cache.RepoCache, var nextEvent ImportEvent var err error for { - // We need the current event and one look ahead event. + // An IssueEvent contains the issue in its most recent state. If an issue + // has at least one issue edit, then the history of the issue edits is + // represented by IssueEditEvents. That is, the unedited (original) issue + // might be saved only in the IssueEditEvent following the IssueEvent. + // Since we replicate the edit history we need to either use the IssueEvent + // (if there are no edits) or the IssueEvent together with its first + // IssueEditEvent (if there are edits). + // Exactly the same is true for comments and comment edits. + // As a consequence we need to look at the current event and one look ahead + // event. currEvent = nextEvent if currEvent == nil { currEvent = gi.getEventHandleMsgs() |