From cc686c66210472bbe8cb16688841f82121f7df1a Mon Sep 17 00:00:00 2001 From: gaatjeniksaan Date: Wed, 17 Sep 2025 11:28:52 +0200 Subject: [PATCH] Fix --no-git argument resolution. The --no-git argument was superfluous as it was set to True by default. This commit flips this, and assumes git is not available, and will check and update only if the user asks for it (--no-git == False). To make this more clear I have renamed the variable to should_init_git. --- src/specify_cli/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/specify_cli/__init__.py b/src/specify_cli/__init__.py index 88c1669..f733f8c 100644 --- a/src/specify_cli/__init__.py +++ b/src/specify_cli/__init__.py @@ -794,10 +794,11 @@ def init( )) # Check git only if we might need it (not --no-git) - git_available = True + # Only set to True if the user wants it and the tool is available + should_init_git = False if not no_git: - git_available = check_tool("git", "https://git-scm.com/downloads") - if not git_available: + should_init_git = check_tool("git", "https://git-scm.com/downloads") + if not should_init_git: console.print("[yellow]Git not found - will skip repository initialization[/yellow]") # AI assistant selection @@ -893,7 +894,7 @@ def init( tracker.start("git") if is_git_repo(project_path): tracker.complete("git", "existing repo detected") - elif git_available: + elif should_init_git: if init_git_repo(project_path, quiet=True): tracker.complete("git", "initialized") else: