X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=setup.c;h=3d2d9580f3283b4e4bc741d98863777510bd5173;hb=319a36a5c2da8dd07993caac43b7820bff3b0d37;hp=89c81e54e6d25d7ba2bec8831621283f32fd3108;hpb=7ab9f8f8b12853d4cb0e45031bf2ee9a0517ad22;p=git.git diff --git a/setup.c b/setup.c index 89c81e54e..3d2d9580f 100644 --- a/setup.c +++ b/setup.c @@ -202,6 +202,8 @@ const char **get_pathspec(const char *prefix, const char **pathspec) const char *p = prefix_path(prefix, prefixlen, *src); if (p) *(dst++) = p; + else + exit(128); /* error message already given */ src++; } *dst = NULL; @@ -323,6 +325,14 @@ const char *setup_git_directory_gently(int *nongit_ok) const char *gitdirenv; int len, offset; + /* + * Let's assume that we are in a git repository. + * If it turns out later that we are somewhere else, the value will be + * updated accordingly. + */ + if (nongit_ok) + *nongit_ok = 0; + /* * If GIT_DIR is set explicitly, we're not going * to do any discovery, but we still do repository