fix: skip git init prompt when directory is already initialized

Description

  • fix: skip git init prompt when directory is already initialized

When running 'glab repo create' in an already git-initialized directory, the tool was incorrectly prompting 'Directory not Git initialized. Run git init?' even though the directory was already initialized.

This fix adds a check to verify if the directory is already git-initializedbefore showing the prompt. The check uses the same logic as the initGit function to determine if a .git directory exists.

Fixes the issue where users would see the misleading prompt and potentially run git init unnecessarily in an already initialized repository.

Address this comment #7487 (comment 2940657573)

How has this been tested?

Screenshots (if appropriate):

Edited by Kai Armstrong

Merge request reports

Loading