reflog: fix expire --single-worktree
commit26d4c51d36a1f4f9463eb694758474243d7877e6
authorRené Scharfe <l.s.r@web.de>
Sat, 28 Oct 2023 11:58:41 +0000 (28 13:58 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sun, 29 Oct 2023 03:19:28 +0000 (29 12:19 +0900)
tree048a4ba0de259ffa16721dc9024877a55ab5bf99
parent43c8a30d150ecede9709c1f2527c8fba92c65f40
reflog: fix expire --single-worktree

33d7bdd645 (builtin/reflog.c: use parse-options api for expire, delete
subcommands, 2022-01-06) broke the option --single-worktree of git
reflog expire and added a non-printable short flag for it, presumably by
accident.  While before it set the variable "all_worktrees" to 0, now it
sets it to 1, its default value.  --no-single-worktree is required now
to set it to 0.

Fix it by replacing the variable with one that has the opposite meaning,
to avoid the negation and its potential for confusion.  The new variable
"single_worktree" directly captures whether --single-worktree was given.

Also remove the unprintable short flag SOH (start of heading) because it
is undocumented, hard to use and is likely to have been added by mistake
in connection with the negation bug above.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/reflog.c
t/t1410-reflog.sh