@@ -2986,8 +2986,10 @@ def git_revparse_tag(gitdir: Optional[str], tagname: str) -> Optional[str]:
return out.strip()
-def git_branch_contains(gitdir: Optional[str], commit_id: str) -> List[str]:
+def git_branch_contains(gitdir: Optional[str], commit_id: str, checkall: bool = False) -> List[str]:
gitargs = ['branch', '--format=%(refname:short)', '--contains', commit_id]
+ if checkall:
+ gitargs.append('--all')
lines = git_get_command_lines(gitdir, gitargs)
return lines
@@ -390,7 +390,7 @@ def start_new_series(cmdargs: argparse.Namespace) -> None:
raise RuntimeError('Object %s not found' % enroll_base)
forkpoint = out.strip()
# check branches where this object lives
- heads = b4.git_branch_contains(None, forkpoint)
+ heads = b4.git_branch_contains(None, forkpoint, checkall=True)
if mybranch not in heads:
logger.critical('CRITICAL: object %s does not exist on current branch', enroll_base)
sys.exit(1)