Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shawn Webb
Git Lab
Commits
95301526
Commit
95301526
authored
Aug 19, 2020
by
Méven Car
Committed by
Jonah Brüchert
Aug 24, 2020
Browse files
Track pushed remote branches
parent
d71f8e25
Changes
1
Hide whitespace changes
Inline
Side-by-side
lab/mergerequestcreator.py
View file @
95301526
...
...
@@ -14,7 +14,7 @@ import sys
from
typing
import
List
,
Any
from
git
import
Remote
,
IndexFile
from
git
import
Remote
,
IndexFile
,
PushInfo
from
gitlab.v4.objects
import
Project
,
ProjectMergeRequest
from
gitlab.exceptions
import
GitlabCreateError
,
GitlabGetError
...
...
@@ -161,13 +161,16 @@ class MergeRequestCreator(RepositoryConnection):
pushes the local repository to the fork remote
"""
remote
:
Remote
info
:
PushInfo
if
self
.
__fork
:
remote
=
self
.
_local_repo
.
remotes
.
fork
remote
.
push
(
force
=
True
)
info
=
remote
.
push
(
force
=
True
)
[
0
]
else
:
remote
=
self
.
_local_repo
.
remotes
.
origin
remote
.
push
(
refspec
=
self
.
_local_repo
.
head
,
force
=
True
)
info
=
remote
.
push
(
refspec
=
self
.
_local_repo
.
head
,
force
=
True
)
[
0
]
self
.
_local_repo
.
active_branch
.
set_tracking_branch
(
info
.
remote_ref
)
def
__upload_assets
(
self
,
text
:
str
)
->
str
:
"""
Scans the text for local file paths, uploads the files and returns
...
...
Write
Preview
Supports
Markdown
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