Commit 4b20a3de authored by George Koltsov's avatar George Koltsov

Update GitHub PRs Importer to force update repository

  - Set `forced: true` flag when fetching remote git
    repository during import from GitHub in order to not
    fail import if any of the refs (tags specifically)
    get changed mid import

Changelog: fixed
parent 04b17ec9
......@@ -40,7 +40,7 @@ module Gitlab
# updating the timestamp.
project.touch(:last_repository_updated_at) # rubocop: disable Rails/SkipsModelValidations
project.repository.fetch_remote(project.import_url, refmap: Gitlab::GithubImport.refmap, forced: false)
project.repository.fetch_remote(project.import_url, refmap: Gitlab::GithubImport.refmap, forced: true)
pname = project.path_with_namespace
......
......@@ -164,7 +164,7 @@ RSpec.describe Gitlab::GithubImport::Importer::PullRequestsImporter do
expect(project.repository)
.to receive(:fetch_remote)
.with(url, forced: false, refmap: Gitlab::GithubImport.refmap)
.with(url, forced: true, refmap: Gitlab::GithubImport.refmap)
freeze_time do
importer.update_repository
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment