Thread (115 messages) 115 messages, 6 authors, 2019-07-11

Re: [WIP RFC PATCH v2 4/5] clone: extract function from copy_or_link_directory

From: Thomas Gummerer <hidden>
Date: 2019-02-27 22:45:59

On 02/27, Matheus Tavares Bernardino wrote:
On Tue, Feb 26, 2019 at 9:18 AM Duy Nguyen [off-list ref] wrote:
quoted
On Tue, Feb 26, 2019 at 12:18 PM Matheus Tavares
[off-list ref] wrote:
quoted
+        */
+       struct stat st;
+
+       if (mkdir(pathname, mode)) {
Good opportunity to unindent this by doing

    if (!mkdir(...
         return;

but it's up to you.
Ok. But being such a small snippet, is the indentation really a code
smell here? (sorry, I'm still getting used to git's coding guidelines)
I don't think the indentation here is too bad here, but I think the
code is slightly easier to read with less indentation, and it's easier
to see what's happening in the success case as well without reading
the whole method.

And since this patch is already refactoring code we could do it here.
I don't think it's a very big deal either way, which is why Duy left
the decision on whether to use the suggestion or not up to you.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help