(line: str)
Get the file mode from the line patch (new, modified or deleted)

        :raise: Exception if filemode is not detected
Get the file mode from the line patch (new, modified or deleted)
Get the file mode from the line patch ( new modified or deleted )
def get_filemode(line: str) -> Filemode:
        """
        Get the file mode from the line patch (new, modified or deleted)

        :raise: Exception if filemode is not detected
        """
        if line.startswith("index"):
            return Filemode.MODIFY
        if line.startswith("similarity"):
            return Filemode.RENAME
        if line.startswith("new"):
            return Filemode.NEW
        if line.startswith("deleted"):
            return Filemode.DELETE
        if line.startswith("old"):
            return Filemode.PERMISSION_CHANGE

        raise click.ClickException(f"Filemode is not detected:{line}")
def get_filemode ( line : str ) -> Filemode : if line . startswith ( "index" ) : return Filemode . MODIFY if line . startswith ( "similarity" ) : return Filemode . RENAME if line . startswith ( "new" ) : return Filemode . NEW if line . startswith ( "deleted" ) : return Filemode . DELETE if line . startswith ( "old" ) : return Filemode . PERMISSION_CHANGE raise click . ClickException ( f"Filemode is not detected:{line}" )