def parse_reftuple(lh_container, rh_container, refspec):
 if refspec.startswith('+'):
  force = True
  refspec = refspec[1:]
 else:
  force = False
 refspec = to_bytes(refspec)
 if (':' in refspec):
  (lh, rh) = refspec.split(':')
 else:
  lh = rh = refspec
 if (lh == ''):
  lh = None
 else:
  lh = parse_ref(lh_container, lh)
 if (rh == ''):
  rh = None
 else:
  try:
   rh = parse_ref(rh_container, rh)
  except KeyError:
   if (not ('/' in rh)):
    rh = ('refs/heads/' + rh)
 return (lh, rh, force)

def parse_reftuple ( lh_container , rh_container , refspec ) : if refspec . startswith ( '+' ) : force = True refspec = refspec [ 1 : ] else : force = False refspec = to_bytes ( refspec ) if ( ':' in refspec ) : ( lh , rh ) = refspec . split ( ':' ) else : lh = rh = refspec if ( lh == '' ) : lh = None else : lh = parse_ref ( lh_container , lh ) if ( rh == '' ) : rh = None else : try : rh = parse_ref ( rh_container , rh ) except KeyError : if ( not ( '/' in rh ) ) : rh = ( 'refs/heads/' + rh ) return ( lh , rh , force )
parse a reftuple spec .