Skip to content

Commit a72c874

Browse files
flichtenheldspearce
authored andcommitted
git-config: don't silently ignore options after --list
Error out if someone gives options after --list since that is not a valid syntax. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
1 parent 304b5af commit a72c874

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

builtin-config.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,11 @@ int cmd_config(int argc, const char **argv, const char *prefix)
172172
type = T_INT;
173173
else if (!strcmp(argv[1], "--bool"))
174174
type = T_BOOL;
175-
else if (!strcmp(argv[1], "--list") || !strcmp(argv[1], "-l"))
175+
else if (!strcmp(argv[1], "--list") || !strcmp(argv[1], "-l")) {
176+
if (argc != 2)
177+
usage(git_config_set_usage);
176178
return git_config(show_all_config);
179+
}
177180
else if (!strcmp(argv[1], "--global")) {
178181
char *home = getenv("HOME");
179182
if (home) {

0 commit comments

Comments
 (0)