summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorKristoffer Haugsbakk <code@khaugsbakk.name>2023-10-20 18:40:07 +0200
committerJunio C Hamano <gitster@pobox.com>2023-10-20 11:06:45 -0700
commitb1688ea02df6fdefd5a228a0d52583356d433a99 (patch)
tree3f72d6fb62c303cebbcc0329288845548766356b /builtin/commit.c
parenta9ecda2788e229afc9b611acaa26d0d9d4da53ed (diff)
grep: die gracefully when outside repository
Die gracefully when `git grep --no-index` is run outside of a Git repository and the path is outside the directory tree. If you are not in a Git repository and say: git grep --no-index search .. You trigger a `BUG`: BUG: environment.c:213: git environment hasn't been setup Aborted (core dumped) Because `..` is a valid path which is treated as a pathspec. Then `pathspec` figures out that it is not in the current directory tree. The `BUG` is triggered when `pathspec` tries to advise the user about how the path is not in the current (non-existing) repository. Reported-by: ks1322 ks1322 <ks1322@gmail.com> Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
0 files changed, 0 insertions, 0 deletions