|
@@ -23,6 +23,7 @@ from command import InteractiveCommand
|
|
|
from editor import Editor
|
|
from editor import Editor
|
|
|
from error import HookError, UploadError
|
|
from error import HookError, UploadError
|
|
|
from git_command import GitCommand
|
|
from git_command import GitCommand
|
|
|
|
|
+from git_refs import R_HEADS
|
|
|
from project import RepoHook
|
|
from project import RepoHook
|
|
|
|
|
|
|
|
from pyversion import is_python3
|
|
from pyversion import is_python3
|
|
@@ -462,7 +463,10 @@ Gerrit Code Review: https://www.gerritcodereview.com/
|
|
|
# Make sure our local branch is not setup to track a different remote branch
|
|
# Make sure our local branch is not setup to track a different remote branch
|
|
|
merge_branch = self._GetMergeBranch(branch.project)
|
|
merge_branch = self._GetMergeBranch(branch.project)
|
|
|
if destination:
|
|
if destination:
|
|
|
- full_dest = 'refs/heads/%s' % destination
|
|
|
|
|
|
|
+ full_dest = destination
|
|
|
|
|
+ if not full_dest.startswith(R_HEADS):
|
|
|
|
|
+ full_dest = R_HEADS + full_dest
|
|
|
|
|
+
|
|
|
if not opt.dest_branch and merge_branch and merge_branch != full_dest:
|
|
if not opt.dest_branch and merge_branch and merge_branch != full_dest:
|
|
|
print('merge branch %s does not match destination branch %s'
|
|
print('merge branch %s does not match destination branch %s'
|
|
|
% (merge_branch, full_dest))
|
|
% (merge_branch, full_dest))
|