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
a5850041
Commit
a5850041
authored
Oct 05, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor improvements after latest review
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
7833d3fb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
14 deletions
+6
-14
app/models/concerns/repository_mirroring.rb
app/models/concerns/repository_mirroring.rb
+4
-8
lib/github/representation/issuable.rb
lib/github/representation/issuable.rb
+1
-3
lib/github/representation/issue.rb
lib/github/representation/issue.rb
+1
-3
No files found.
app/models/concerns/repository_mirroring.rb
View file @
a5850041
module
RepositoryMirroring
module
RepositoryMirroring
IMPORT_REFS
=
%w[
IMPORT_HEAD_REFS
=
'+refs/heads/*:refs/heads/*'
.
freeze
+refs/heads/*:refs/heads/*
IMPORT_TAG_REFS
=
'+refs/tags/*:refs/tags/*'
.
freeze
+refs/tags/*:refs/tags/*
]
.
freeze
def
set_remote_as_mirror
(
name
)
def
set_remote_as_mirror
(
name
)
# This is used to define repository as equivalent as "git clone --mirror"
# This is used to define repository as equivalent as "git clone --mirror"
...
@@ -13,11 +11,9 @@ module RepositoryMirroring
...
@@ -13,11 +11,9 @@ module RepositoryMirroring
def
set_import_remote_as_mirror
(
remote_name
)
def
set_import_remote_as_mirror
(
remote_name
)
# Add first fetch with Rugged so it does not create its own.
# Add first fetch with Rugged so it does not create its own.
raw_repository
.
rugged
.
config
[
"remote.
#{
remote_name
}
.fetch"
]
=
IMPORT_
REFS
.
first
raw_repository
.
rugged
.
config
[
"remote.
#{
remote_name
}
.fetch"
]
=
IMPORT_
HEAD_REFS
IMPORT_REFS
.
drop
(
1
).
each
do
|
refspec
|
add_remote_fetch_config
(
remote_name
,
IMPORT_TAG_REFS
)
add_remote_fetch_config
(
remote_name
,
refspec
)
end
raw_repository
.
rugged
.
config
[
"remote.
#{
remote_name
}
.mirror"
]
=
true
raw_repository
.
rugged
.
config
[
"remote.
#{
remote_name
}
.mirror"
]
=
true
raw_repository
.
rugged
.
config
[
"remote.
#{
remote_name
}
.prune"
]
=
true
raw_repository
.
rugged
.
config
[
"remote.
#{
remote_name
}
.prune"
]
=
true
...
...
lib/github/representation/issuable.rb
View file @
a5850041
...
@@ -28,9 +28,7 @@ module Github
...
@@ -28,9 +28,7 @@ module Github
end
end
def
labels
def
labels
return
[]
unless
labels?
@labels
||=
Array
(
raw
[
'labels'
]).
map
do
|
label
|
@labels
||=
raw
[
'labels'
].
map
do
|
label
|
Github
::
Representation
::
Label
.
new
(
label
,
options
)
Github
::
Representation
::
Label
.
new
(
label
,
options
)
end
end
end
end
...
...
lib/github/representation/issue.rb
View file @
a5850041
...
@@ -18,9 +18,7 @@ module Github
...
@@ -18,9 +18,7 @@ module Github
end
end
def
assignees
def
assignees
return
[]
unless
assigned?
@assignees
||=
Array
(
raw
[
'assignees'
]).
map
do
|
user
|
@assignees
||=
raw
[
'assignees'
].
map
do
|
user
|
Github
::
Representation
::
User
.
new
(
user
,
options
)
Github
::
Representation
::
User
.
new
(
user
,
options
)
end
end
end
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