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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux