+def check(args, input=None):
+ return subprocess.check_output(args, text=True, input=input).strip()
+
+
+# config repo and branch
+REPO = "/srv/git/git-hooks"
+BRANCH = "main"
+
+# cd into repo
+os.chdir(REPO)
+
+# list all directories
+dirs = check(["git", "ls-tree", "--name-only", BRANCH]).splitlines()