diff --git a/git-tidy b/git-tidy index 86762eb..951dd08 100755 --- a/git-tidy +++ b/git-tidy @@ -125,9 +125,8 @@ def get_default_branch() -> str: return branch_list[selection] - -if __name__ == "__main__": - +def main(): + """Main function.""" default_branch = get_default_branch() print(f"Switching to {default_branch}") run(["git", "checkout", default_branch]) @@ -156,3 +155,6 @@ if __name__ == "__main__": for branch in merged_branches: if branch[0] != "*": # This time we want to explicitly exclude the checked-out branch. subprocess.run(["git", "branch", "-d", branch.strip()], check=True) + +if __name__ == "__main__": + main()