diff options
author | Stan Hu <stanhu@gmail.com> | 2019-03-26 09:26:12 -0500 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-04-07 06:56:49 -0700 |
commit | d7c1bed80d55611ca297c5c7664658d1144c5a85 (patch) | |
tree | d9efba6f9bd17c9eb1b9399c6479c381107bd3c5 /spec | |
parent | 33316f7f176d76b05bcf8bd0ff4d9dbc43e7c061 (diff) | |
download | gitlab-ce-d7c1bed80d55611ca297c5c7664658d1144c5a85.tar.gz |
GitHub import: Run housekeeping after initial importsh-git-gc-after-initial-fetch
After an initial fetch, the repository will have many loose objects
and refs. Running a `git gc` will compact refs into `packed-refs` and
objects into `.pack` files, which should make importing pull
requests faster.
Part of https://gitlab.com/gitlab-org/gitlab-ce/issues/59477
Diffstat (limited to 'spec')
-rw-r--r-- | spec/lib/gitlab/github_import/importer/repository_importer_spec.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/lib/gitlab/github_import/importer/repository_importer_spec.rb b/spec/lib/gitlab/github_import/importer/repository_importer_spec.rb index 41810a8ec03..705df1f4fe7 100644 --- a/spec/lib/gitlab/github_import/importer/repository_importer_spec.rb +++ b/spec/lib/gitlab/github_import/importer/repository_importer_spec.rb @@ -197,6 +197,11 @@ describe Gitlab::GithubImport::Importer::RepositoryImporter do .to receive(:fetch_as_mirror) .with(project.import_url, refmap: Gitlab::GithubImport.refmap, forced: true, remote_name: 'github') + service = double + expect(Projects::HousekeepingService) + .to receive(:new).with(project, :gc).and_return(service) + expect(service).to receive(:execute) + expect(importer.import_repository).to eq(true) end |