move-script: Be explicit about the ref to push to

Otherwise, a local `push.default` setting could interfere with this.
E.g. setting it to `upstream` can cause the script to attempt to push to
`main`.
This commit is contained in:
Jan Alexander Steffens (heftig) 2021-10-04 14:41:10 +02:00 committed by Jan Alexander Steffens (heftig)
parent f54c2a2bac
commit 580597d0b2
No known key found for this signature in database
GPG key ID: 3B94A80E50A477C7

View file

@ -487,9 +487,10 @@ class GstMRMover:
def push_branch(self, branch):
fprint(
f"-> Pushing branch {branch} to remote {self.gl.user.username}...")
if self.git("push", "--no-verify", self.gl.user.username, branch,
refspec = f"{branch}:refs/heads/{branch}"
if self.git("push", "--no-verify", self.gl.user.username, refspec,
interaction_message=f"pushing {branch} to {self.gl.user.username} with:\n "
f" `$git push {self.gl.user.username} {branch}`") == "SKIP":
f" `$git push {self.gl.user.username} {refspec}`") == "SKIP":
fprint(yellow("'SKIPPED' (couldn't push)"), nested=False)
return False