X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=remote-curl.c;h=ebdab3603ec767b42ce04e0de2c3deeb516f2525;hb=8db751a8f953bf1a571e1fd825d1a4219e65b501;hp=ad6a1637b52dedeeb461315e9cc0d313b1c6087f;hpb=f539cfbe8c157885197d1b6e4c1bcc6cbc54d0b9;p=~andy%2Fgit diff --git a/remote-curl.c b/remote-curl.c index ad6a1637b..ebdab3603 100644 --- a/remote-curl.c +++ b/remote-curl.c @@ -3,6 +3,7 @@ #include "strbuf.h" #include "walker.h" #include "http.h" +#include "exec_cmd.h" static struct ref *get_refs(struct walker *walker, const char *url) { @@ -81,8 +82,10 @@ int main(int argc, const char **argv) struct strbuf buf = STRBUF_INIT; const char *url; struct walker *walker = NULL; + int nongit; - setup_git_directory(); + git_extract_argv0_path(argv[0]); + setup_git_directory_gently(&nongit); if (argc < 2) { fprintf(stderr, "Remote needed\n"); return 1; @@ -101,6 +104,8 @@ int main(int argc, const char **argv) break; if (!prefixcmp(buf.buf, "fetch ")) { char *obj = buf.buf + strlen("fetch "); + if (nongit) + die("Fetch attempted without a local repo"); if (!walker) walker = get_http_walker(url, remote); walker->get_all = 1;