Subject: Re: [PATCH] sequencer: rectify empty hint in call of require_clean_work_tree()

From: Oswald Buddenhagen <[email-masked]>
Date: Fri, 28 Apr 2023 00:33:56 +0200

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.

>--- 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