]> git.ipfire.org Git - thirdparty/git.git/commitdiff
builtin/reflog.c: fix dry-run option short name
authorJosh Brobst <josh@brob.st>
Sun, 26 Nov 2023 00:05:14 +0000 (19:05 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sun, 26 Nov 2023 00:35:42 +0000 (09:35 +0900)
The documentation for reflog states that the --dry-run option of the
expire and delete subcommands has a corresponding short name, -n.
However, 33d7bdd645 (builtin/reflog.c: use parse-options api for expire,
delete subcommands, 2022-01-06) did not include this short name in the
new options parsing.

Re-add the short name in the new dry-run option definitions.

Signed-off-by: Josh Brobst <josh@brob.st>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/reflog.c

index 85b838720c364ae54c5ebf410a58921e6f8fd73e..f2acecac9a0ce7a02572f6e7e53d1e94059c27a0 100644 (file)
@@ -592,7 +592,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
        int verbose = 0;
        reflog_expiry_should_prune_fn *should_prune_fn = should_expire_reflog_ent;
        const struct option options[] = {
-               OPT_BIT(0, "dry-run", &flags, N_("do not actually prune any entries"),
+               OPT_BIT('n', "dry-run", &flags, N_("do not actually prune any entries"),
                        EXPIRE_REFLOGS_DRY_RUN),
                OPT_BIT(0, "rewrite", &flags,
                        N_("rewrite the old SHA1 with the new SHA1 of the entry that now precedes it"),
@@ -728,7 +728,7 @@ static int cmd_reflog_delete(int argc, const char **argv, const char *prefix)
        int verbose = 0;
        reflog_expiry_should_prune_fn *should_prune_fn = should_expire_reflog_ent;
        const struct option options[] = {
-               OPT_BIT(0, "dry-run", &flags, N_("do not actually prune any entries"),
+               OPT_BIT('n', "dry-run", &flags, N_("do not actually prune any entries"),
                        EXPIRE_REFLOGS_DRY_RUN),
                OPT_BIT(0, "rewrite", &flags,
                        N_("rewrite the old SHA1 with the new SHA1 of the entry that now precedes it"),