def check_ref_format(refname):
 if (('/.' in refname) or refname.startswith('.')):
  return False
 if ('/' not in refname):
  return False
 if ('..' in refname):
  return False
 for (i, c) in enumerate(refname):
  if ((ord(refname[i:(i + 1)]) < 32) or (c in BAD_REF_CHARS)):
   return False
 if (refname[(-1)] in '/.'):
  return False
 if refname.endswith('.lock'):
  return False
 if ('@{' in refname):
  return False
 if ('\\' in refname):
  return False
 return True

def check_ref_format ( refname ) : if ( ( '/.' in refname ) or refname . startswith ( '.' ) ) : return False if ( '/' not in refname ) : return False if ( '..' in refname ) : return False for ( i , c ) in enumerate ( refname ) : if ( ( ord ( refname [ i : ( i + 1 ) ] ) < 32 ) or ( c in BAD_REF_CHARS ) ) : return False if ( refname [ ( - 1 ) ] in '/.' ) : return False if refname . endswith ( '.lock' ) : return False if ( '@{' in refname ) : return False if ( '\\' in refname ) : return False return True
check if a refname is correctly formatted .