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
4ad0f223
Commit
4ad0f223
authored
Jun 17, 2016
by
Jacob Vosmaer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Set GL_ID in MergeRequests::RebaseService
parent
26909fe4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
app/services/merge_requests/rebase_service.rb
app/services/merge_requests/rebase_service.rb
+19
-3
No files found.
app/services/merge_requests/rebase_service.rb
View file @
4ad0f223
...
...
@@ -27,7 +27,11 @@ module MergeRequests
end
# Clone
output
,
status
=
popen
(
%W(git clone -b
#{
merge_request
.
source_branch
}
--
#{
source_project
.
repository
.
path_to_repo
}
#{
tree_path
}
)
)
output
,
status
=
popen
(
%W(git clone -b
#{
merge_request
.
source_branch
}
--
#{
source_project
.
repository
.
path_to_repo
}
#{
tree_path
}
)
,
nil
,
git_env
)
unless
status
.
zero?
log
(
'Failed to clone repository for rebase:'
)
...
...
@@ -36,7 +40,11 @@ module MergeRequests
end
# Rebase
output
,
status
=
popen
(
%W(git pull --rebase
#{
target_project
.
repository
.
path_to_repo
}
#{
merge_request
.
target_branch
}
)
,
tree_path
)
output
,
status
=
popen
(
%W(git pull --rebase
#{
target_project
.
repository
.
path_to_repo
}
#{
merge_request
.
target_branch
}
)
,
tree_path
,
git_env
)
unless
status
.
zero?
log
(
'Failed to rebase branch:'
)
...
...
@@ -45,7 +53,11 @@ module MergeRequests
end
# Push
output
,
status
=
popen
(
%W(git push -f origin
#{
merge_request
.
source_branch
}
)
,
tree_path
)
output
,
status
=
popen
(
%W(git push -f origin
#{
merge_request
.
source_branch
}
)
,
tree_path
,
git_env
)
unless
status
.
zero?
log
(
'Failed to push rebased branch:'
)
...
...
@@ -80,5 +92,9 @@ module MergeRequests
def
clean_dir
FileUtils
.
rm_rf
(
tree_path
)
if
File
.
exist?
(
tree_path
)
end
def
git_env
{
'GL_ID'
=>
Gitlab
::
GlId
.
gl_id
(
current_user
)
}
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