]> git.ipfire.org Git - thirdparty/git.git/blobdiff - http-fetch.c
Merge branch 'pb/doc-sequence-editor-configuration'
[thirdparty/git.git] / http-fetch.c
index 1df376e745ce69390bf8dda422882906a5f747ec..c4ccc5fea93cff445785bb101c8438b9374d1b74 100644 (file)
@@ -84,8 +84,11 @@ int cmd_main(int argc, const char **argv)
        int get_verbosely = 0;
        int get_recover = 0;
        int packfile = 0;
+       int nongit;
        struct object_id packfile_hash;
 
+       setup_git_directory_gently(&nongit);
+
        while (arg < argc && argv[arg][0] == '-') {
                const char *p;
 
@@ -115,7 +118,8 @@ int cmd_main(int argc, const char **argv)
        if (argc != arg + 2 - (commits_on_stdin || packfile))
                usage(http_fetch_usage);
 
-       setup_git_directory();
+       if (nongit)
+               die(_("not a git repository"));
 
        git_config(git_default_config, NULL);