Re: [PATCH] sequencer: rectify empty hint in call of require_clean_work_tree()
- From
Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
- Date
- Apr 27, 2023, 22:33 UTC
- Message-ID
- <ZEr4VKMPSYZZxgIM@ugly>
- In-Reply-To
- <xmqqmt2thvuu.fsf@gitster.g>
On Thu, Apr 27, 2023 at 02:13:29PM -0700, Junio C Hamano wrote:
>I think the right fix would be more like the attached patch, which >will fix any other callsites that pass "" at the same time. Of >course, you can fix the callers on top, but that is secondary. >
there is only that one incorrect (in-tree) call. i don't think that making the behavior more compliant with the shell implementation is particularly elegant or even useful. if i wanted to be super-pedantic about it, i'd assert that non-null strings are non-empty. but that would only help if all error paths actually have test coverage.
Show 7 quoted lines
>--- i/wt-status.c
>+++ w/wt-status.c
>@@ -2650,7 +2650,7 @@ int require_clean_work_tree(struct repository *r,
>
>- if (hint)
>+ if (hint && *hint)
> error("%s", hint);-- ossi