Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
from stgit.config import config
from stgit.lib import git, stack
from stgit.out import out
from stgit.config import config
from stgit.lib import git, stack
from stgit.out import out
help = 'Publish the stack changes to a merge-friendly head'
kind = 'stack'
help = 'Publish the stack changes to a merge-friendly head'
kind = 'stack'
else:
parser.error('incorrect number of arguments')
else:
parser.error('incorrect number of arguments')
+ if not public_ref.startswith('refs/heads/'):
+ public_ref = 'refs/heads/' + public_ref
+
# just clone the stack if the public ref does not exist
if not repository.refs.exists(public_ref):
repository.refs.set(public_ref, stack.head, 'publish')
# just clone the stack if the public ref does not exist
if not repository.refs.exists(public_ref):
repository.refs.set(public_ref, stack.head, 'publish')
merge_bases = repository.get_merge_bases(public_head, stack.base)
if not stack.base in merge_bases:
message = 'Merge %s into %s' % (repository.describe(stack.base),
merge_bases = repository.get_merge_bases(public_head, stack.base)
if not stack.base in merge_bases:
message = 'Merge %s into %s' % (repository.describe(stack.base),
+ utils.strip_prefix('refs/heads/',
+ public_ref))
public_head = __create_commit(repository, stack.head.data.tree,
[public_head, stack.base], options,
message)
public_head = __create_commit(repository, stack.head.data.tree,
[public_head, stack.base], options,
message)