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
413cb0af
Commit
413cb0af
authored
Mar 03, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git fetch --force using gitlab-shell instead
parent
baa48794
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
GITLAB_SHELL_VERSION
GITLAB_SHELL_VERSION
+1
-1
app/models/repository.rb
app/models/repository.rb
+2
-3
lib/gitlab/backend/shell.rb
lib/gitlab/backend/shell.rb
+5
-2
No files found.
GITLAB_SHELL_VERSION
View file @
413cb0af
2.6.1
0
2.6.1
1
app/models/repository.rb
View file @
413cb0af
...
...
@@ -184,7 +184,7 @@ class Repository
def
set_remote_as_mirror
(
name
)
remote_config
=
raw_repository
.
rugged
.
config
# This is used by Gitlab Geo to define repository as equivalent as "git clone --mirror"
remote_config
[
"remote.
#{
name
}
.fetch"
]
=
'refs/*:refs/*'
remote_config
[
"remote.
#{
name
}
.mirror"
]
=
true
...
...
@@ -196,8 +196,7 @@ class Repository
end
def
fetch_remote_forced!
(
remote
)
args
=
%W(
#{
Gitlab
.
config
.
git
.
bin_path
}
fetch
#{
remote
}
-f)
Gitlab
::
Popen
.
popen
(
args
,
path_to_repo
)
gitlab_shell
.
fetch_remote
(
path_with_namespace
,
remote
,
true
)
end
def
branch_names
...
...
lib/gitlab/backend/shell.rb
View file @
413cb0af
...
...
@@ -45,12 +45,15 @@ module Gitlab
#
# name - project path with namespace
# remote - remote name
# forced - should we use --force flag?
#
# Ex.
# fetch_remote("gitlab/gitlab-ci", "upstream")
#
def
fetch_remote
(
name
,
remote
)
output
,
status
=
Popen
::
popen
([
gitlab_shell_projects_path
,
'fetch-remote'
,
"
#{
name
}
.git"
,
remote
,
'600'
])
def
fetch_remote
(
name
,
remote
,
forced
=
false
)
args
=
[
gitlab_shell_projects_path
,
'fetch-remote'
,
"
#{
name
}
.git"
,
remote
,
'600'
]
args
<<
'--force'
if
forced
output
,
status
=
Popen
::
popen
(
args
)
raise
Error
,
output
unless
status
.
zero?
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