aboutsummaryrefslogtreecommitdiffstats
path: root/bridge
diff options
context:
space:
mode:
authorAlexander Scharinger <rng.dynamics@gmail.com>2021-04-08 23:17:24 +0200
committerAlexander Scharinger <rng.dynamics@gmail.com>2021-04-08 23:20:05 +0200
commitede5e218ac4ae492f06be9d3bb8a1e9463eda739 (patch)
treeb0ebda8652d852076b54ea47b8c760088227c9bd /bridge
parent3d14e2e67c4985c429471ea6643f013ade2c2692 (diff)
downloadgit-bug-ede5e218ac4ae492f06be9d3bb8a1e9463eda739.tar.gz
Add comment to clarify look ahead in import channel
Diffstat (limited to 'bridge')
-rw-r--r--bridge/github/import.go11
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()