Skip to content

Commit e9008b9

Browse files
peffgitster
authored andcommitted
parseopt: add OPT_NEGBIT
On Thu, May 07, 2009 at 09:44:17PM +0200, René Scharfe wrote: Subject: [PATCH] ls-files: make --no-empty-directory properly negatable This option was specified to parseopt as an OPT_BIT; however, we actually want to _set_ the bit on --no-empty-directory. Thus the existing implementation used --no-empty-directory, and required --no-no-empty-directory to negate it. Now that OPT_NEGBIT exists, we can properly support it as --empty-directory and --no-empty-directory (but of course still defaulting to showing empty directories). Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 2f4b97f commit e9008b9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin-ls-files.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ int cmd_ls_files(int argc, const char **argv, const char *prefix)
454454
OPT_BIT(0, "directory", &dir.flags,
455455
"show 'other' directories' name only",
456456
DIR_SHOW_OTHER_DIRECTORIES),
457-
OPT_BIT(0, "no-empty-directory", &dir.flags,
457+
OPT_NEGBIT(0, "empty-directory", &dir.flags,
458458
"don't show empty directories",
459459
DIR_HIDE_EMPTY_DIRECTORIES),
460460
OPT_BOOLEAN('u', "unmerged", &show_unmerged,

0 commit comments

Comments
 (0)