From: Junio C Hamano Date: Mon, 25 Sep 2017 03:55:13 GMT Subject: Re: [PATCH v5 3/4] submodule: port set_name_rev() from shell to C Message-ID: In-Reply-To: Junio C Hamano writes: > Nicely done. > >> + if (!capture_command(&cp, &sb, 0) && sb.len) { > ... > So, while it is not wrong per-se, I do not think we need to check > revname[0] here. The helper never returns a non-NULL pointer that > points at an empty string, right? > > On the other hand, if we dropped the "&& sb.len" check in the helper > function to be more faithful to the original, then we must check > revname[0] for an empty string. Ah, ignore all of the above. This will all be discarded in the next step [4/4], as far as I can tell. Perhaps we should drop this step and get directly to it, making the result a three-patch series instead, then, no?