fix(snippet): show friendly error for project snippet without repo
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
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