Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1b01deca
Commit
1b01deca
authored
Apr 07, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
00bb7a8b
b4165554
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
0 deletions
+15
-0
changelogs/unreleased/sh-git-gc-after-initial-fetch.yml
changelogs/unreleased/sh-git-gc-after-initial-fetch.yml
+5
-0
lib/gitlab/github_import/importer/repository_importer.rb
lib/gitlab/github_import/importer/repository_importer.rb
+5
-0
spec/lib/gitlab/github_import/importer/repository_importer_spec.rb
...gitlab/github_import/importer/repository_importer_spec.rb
+5
-0
No files found.
changelogs/unreleased/sh-git-gc-after-initial-fetch.yml
0 → 100644
View file @
1b01deca
---
title
:
'
GitHub
import:
Run
housekeeping
after
initial
import'
merge_request
:
26600
author
:
type
:
performance
lib/gitlab/github_import/importer/repository_importer.rb
View file @
1b01deca
...
...
@@ -54,6 +54,11 @@ module Gitlab
project
.
repository
.
fetch_as_mirror
(
project
.
import_url
,
refmap:
refmap
,
forced:
true
,
remote_name:
'github'
)
project
.
change_head
(
default_branch
)
if
default_branch
# The initial fetch can bring in lots of loose refs and objects.
# Running a `git gc` will make importing pull requests faster.
Projects
::
HousekeepingService
.
new
(
project
,
:gc
).
execute
true
rescue
Gitlab
::
Git
::
Repository
::
NoRepository
,
Gitlab
::
Shell
::
Error
=>
e
fail_import
(
"Failed to import the repository:
#{
e
.
message
}
"
)
...
...
spec/lib/gitlab/github_import/importer/repository_importer_spec.rb
View file @
1b01deca
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment