commit/status -h: show usage even with broken configuration
[gitweb.git] / builtin / checkout-index.c
index a7a5ee10f32d52c7555f85f2dcf6c567425488dd..3bf342232b74011e627d3cf6f5bea1a159f5ead9 100644 (file)
@@ -241,6 +241,9 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
                OPT_END()
        };
 
+       if (argc == 2 && !strcmp(argv[1], "-h"))
+               usage_with_options(builtin_checkout_index_usage,
+                                  builtin_checkout_index_options);
        git_config(git_default_config, NULL);
        state.base_dir = "";
        prefix_length = prefix ? strlen(prefix) : 0;