summaryrefslogtreecommitdiff
path: root/remote-curl.c
diff options
context:
space:
mode:
Diffstat (limited to 'remote-curl.c')
-rw-r--r--remote-curl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/remote-curl.c b/remote-curl.c
index 0d7cf16..4f28c22 100644
--- a/remote-curl.c
+++ b/remote-curl.c
@@ -745,9 +745,10 @@ static void parse_push(struct strbuf *buf)
int main(int argc, const char **argv)
{
struct strbuf buf = STRBUF_INIT;
+ int nongit;
git_extract_argv0_path(argv[0]);
- setup_git_directory();
+ setup_git_directory_gently(&nongit);
if (argc < 2) {
fprintf(stderr, "Remote needed\n");
return 1;
@@ -769,6 +770,8 @@ int main(int argc, const char **argv)
if (strbuf_getline(&buf, stdin, '\n') == EOF)
break;
if (!prefixcmp(buf.buf, "fetch ")) {
+ if (nongit)
+ die("Fetch attempted without a local repo");
parse_fetch(&buf);
} else if (!strcmp(buf.buf, "list") || !prefixcmp(buf.buf, "list ")) {