aboutsummaryrefslogtreecommitdiffstats
path: root/bridge/github/import.go
diff options
context:
space:
mode:
authorAmine Hilaly <hilalyamine@gmail.com>2019-05-04 22:26:54 +0200
committerAmine Hilaly <hilalyamine@gmail.com>2019-05-05 18:16:10 +0200
commit7d0296337287ed3d5a97f15c64d51d24340f2567 (patch)
treefbc4c350dc648f72f5f8a0cae71801d04816a06b /bridge/github/import.go
parenteec17050f1fbc8565dcd117329b24c201ac476b1 (diff)
downloadgit-bug-7d0296337287ed3d5a97f15c64d51d24340f2567.tar.gz
Add old importer comments in the iterator
Test operation authors Fix typo in test repo url
Diffstat (limited to 'bridge/github/import.go')
-rw-r--r--bridge/github/import.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/bridge/github/import.go b/bridge/github/import.go
index ad9d5046..e72a2a45 100644
--- a/bridge/github/import.go
+++ b/bridge/github/import.go
@@ -42,6 +42,8 @@ func (gi *githubImporter) ImportAll(repo *cache.RepoCache, since time.Time) erro
// get issue edits
issueEdits := []userContentEdit{}
for iterator.NextIssueEdit() {
+ // issueEdit.Diff == nil happen if the event is older than early 2018, Github doesn't have the data before that.
+ // Best we can do is to ignore the event.
if issueEdit := iterator.IssueEditValue(); issueEdit.Diff != nil && string(*issueEdit.Diff) != "" {
issueEdits = append(issueEdits, issueEdit)
}
@@ -130,6 +132,7 @@ func (gi *githubImporter) ensureIssue(repo *cache.RepoCache, issue issueTimeline
// create bug from given issueEdits
for i, edit := range issueEdits {
if i == 0 && b != nil {
+ // The first edit in the github result is the issue creation itself, we already have that
continue
}
@@ -323,6 +326,7 @@ func (gi *githubImporter) ensureTimelineComment(repo *cache.RepoCache, b *cache.
} else {
for i, edit := range item.UserContentEdits.Nodes {
if i == 0 && target != "" {
+ // The first edit in the github result is the comment creation itself, we already have that
continue
}