aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAmine <hilalyamine@gmail.com>2019-12-09 15:22:14 +0100
committerGitHub <noreply@github.com>2019-12-09 15:22:14 +0100
commit69af7a1e0c2647c354fd9c5b55a254ba677200e1 (patch)
tree3c842c42c715d10e9a0b9eccb69dad62ba3683cf
parent981a4a848b1329da1a73270e27633911f9298bb1 (diff)
parent8f7f89561b59a0988d56bc41a30093730e35f70e (diff)
downloadgit-bug-69af7a1e0c2647c354fd9c5b55a254ba677200e1.tar.gz
Merge pull request #272 from MichaelMure/fix-import-time-save
bridge: fix incorrect last import time on context cancel
-rw-r--r--bridge/github/import.go2
-rw-r--r--commands/bridge_pull.go18
2 files changed, 15 insertions, 5 deletions
diff --git a/bridge/github/import.go b/bridge/github/import.go
index c0fb3d6c..67ab9351 100644
--- a/bridge/github/import.go
+++ b/bridge/github/import.go
@@ -78,7 +78,7 @@ func (gi *githubImporter) ImportAll(ctx context.Context, repo *cache.RepoCache,
}
}
- if err := gi.iterator.Error(); err != nil && err != context.Canceled {
+ if err := gi.iterator.Error(); err != nil {
gi.out <- core.NewImportError(err, "")
}
}()
diff --git a/commands/bridge_pull.go b/commands/bridge_pull.go
index 67f19024..2dd3d93e 100644
--- a/commands/bridge_pull.go
+++ b/commands/bridge_pull.go
@@ -96,15 +96,25 @@ func runBridgePull(cmd *cobra.Command, args []string) error {
importedIssues := 0
importedIdentities := 0
for result := range events {
- if result.Event != core.ImportEventNothing {
- fmt.Println(result.String())
- }
-
switch result.Event {
+ case core.ImportEventNothing:
+ // filtered
+
case core.ImportEventBug:
importedIssues++
+ fmt.Println(result.String())
+
case core.ImportEventIdentity:
importedIdentities++
+ fmt.Println(result.String())
+
+ case core.ImportEventError:
+ if result.Err != context.Canceled {
+ fmt.Println(result.String())
+ }
+
+ default:
+ fmt.Println(result.String())
}
}