Skip to content

Commit 87d4998

Browse files
authored
Merge pull request #303 from gaatjeniksaan/main
Fix --no-git argument resolution.
2 parents 10e56aa + cc686c6 commit 87d4998

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/specify_cli/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -796,10 +796,11 @@ def init(
796796
))
797797

798798
# Check git only if we might need it (not --no-git)
799-
git_available = True
799+
# Only set to True if the user wants it and the tool is available
800+
should_init_git = False
800801
if not no_git:
801-
git_available = check_tool("git", "https://git-scm.com/downloads")
802-
if not git_available:
802+
should_init_git = check_tool("git", "https://git-scm.com/downloads")
803+
if not should_init_git:
803804
console.print("[yellow]Git not found - will skip repository initialization[/yellow]")
804805

805806
# AI assistant selection
@@ -900,7 +901,7 @@ def init(
900901
tracker.start("git")
901902
if is_git_repo(project_path):
902903
tracker.complete("git", "existing repo detected")
903-
elif git_available:
904+
elif should_init_git:
904905
if init_git_repo(project_path, quiet=True):
905906
tracker.complete("git", "initialized")
906907
else:

0 commit comments

Comments
 (0)