def branch_create(repo, name, objectish=None, force=False):
 with open_repo_closing(repo) as r:
  if isinstance(name, bytes):
   names = [name]
  elif isinstance(name, list):
   names = name
  else:
   raise TypeError(('Unexpected branch name type %r' % name))
  if (objectish is None):
   objectish = 'HEAD'
  object = parse_object(r, objectish)
  refname = ('refs/heads/' + name)
  if ((refname in r.refs) and (not force)):
   raise KeyError(('Branch with name %s already exists.' % name))
  r.refs[refname] = object.id

def branch_create ( repo , name , objectish = None , force = False ) : with open_repo_closing ( repo ) as r : if isinstance ( name , bytes ) : names = [ name ] elif isinstance ( name , list ) : names = name else : raise TypeError ( ( 'Unexpected branch name type %r' % name ) ) if ( objectish is None ) : objectish = 'HEAD' object = parse_object ( r , objectish ) refname = ( 'refs/heads/' + name ) if ( ( refname in r . refs ) and ( not force ) ) : raise KeyError ( ( 'Branch with name %s already exists.' % name ) ) r . refs [ refname ] = object . id
create a branch .