fix(snippet): show friendly error for project snippet without repo

Description

  • fix(snippet): show friendly error for project snippet without repo

Fixes #7754 (closed)

Related Issues

Resolves #[issue_number]

How has this been tested?

Screenshots (if appropriate):

Before:

$ glab snippet create -t "snippet create test" --filename "xxx" < file1.go
ERROR: fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
git: exit status 128

After:

$ glab snippet create -t "snippet create test" --filename "xxx" < file1.go
x Project snippet needs a repository. Do you want --personal?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)
  • Test gap
Edited by Jay McCure

Merge request reports

Loading