def _split_ref_line(line):
 fields = line.rstrip('\n\r').split(' ')
 if (len(fields) != 2):
  raise PackedRefsException(('invalid ref line %r' % line))
 (sha, name) = fields
 if (not valid_hexsha(sha)):
  raise PackedRefsException(('Invalid hex sha %r' % sha))
 if (not check_ref_format(name)):
  raise PackedRefsException(('invalid ref name %r' % name))
 return (sha, name)

def _split_ref_line ( line ) : fields = line . rstrip ( '\n\r' ) . split ( ' ' ) if ( len ( fields ) != 2 ) : raise PackedRefsException ( ( 'invalid ref line %r' % line ) ) ( sha , name ) = fields if ( not valid_hexsha ( sha ) ) : raise PackedRefsException ( ( 'Invalid hex sha %r' % sha ) ) if ( not check_ref_format ( name ) ) : raise PackedRefsException ( ( 'invalid ref name %r' % name ) ) return ( sha , name )
split a single ref line into a tuple of sha1 and name .