]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/config.c
Merge branch 'mt/config-fail-nongit-early'
[thirdparty/git.git] / builtin / config.c
index 5e39f6188542bb28cd859e52b883d13fcbd281fe..53e411d68afe631280e4386ba2782e66787b6a42 100644 (file)
@@ -628,11 +628,15 @@ int cmd_config(int argc, const char **argv, const char *prefix)
                usage_builtin_config();
        }
 
-       if (use_local_config && nongit)
-               die(_("--local can only be used inside a git repository"));
+       if (nongit) {
+               if (use_local_config)
+                       die(_("--local can only be used inside a git repository"));
+               if (given_config_source.blob)
+                       die(_("--blob can only be used inside a git repository"));
+               if (use_worktree_config)
+                       die(_("--worktree can only be used inside a git repository"));
 
-       if (given_config_source.blob && nongit)
-               die(_("--blob can only be used inside a git repository"));
+       }
 
        if (given_config_source.file &&
                        !strcmp(given_config_source.file, "-")) {