From f04063f2f9c20523a5ab1349e331eb53a51efc87 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Fri, 4 Oct 2024 08:00:34 -0700 Subject: add more tools --- src/git/__init__.py | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 src/git/__init__.py (limited to 'src/git/__init__.py') diff --git a/src/git/__init__.py b/src/git/__init__.py deleted file mode 100644 index 319fea2..0000000 --- a/src/git/__init__.py +++ /dev/null @@ -1,14 +0,0 @@ -from subprocess import CalledProcessError, check_output - - -def root() -> str: - try: - root = check_output(["git", "rev-parse", "--show-toplevel"]).decode("utf-8").strip() - return root - except CalledProcessError as err: - raise OSError("Current working directory is not a git repository") from err - - -def repository_name() -> str: - repo_path = root() - return repo_path.split("/")[-1] -- cgit 1.4.1