(path: Optional[Path] = None)
Get head commit for git dir at dirPath
Get head commit for git dir at dirPath
Get head commit for git dir at dirPath
def commit(path: Optional[Path] = None) -> Optional[str]:
    """Get head commit for git dir at dirPath"""
    r = repo()
    if r is None:
        return None
    try:
        return str(r.head.commit)
    except ValueError:
        # catch case where local git repo without remote master
        return None
def commit ( path : Optional [ Path ] = None ) -> Optional [ str ] : r = repo ( ) if r is None : return None try : return str ( r . head . commit ) except ValueError : # catch case where local git repo without remote master return None