Thread (2 messages) 2 messages, 2 authors, 2019-10-29

Re: [Outreachy] [PATCH] clone: rename static function `dir_exists()`.

From: Miriam R. <hidden>
Date: 2019-10-29 20:14:32

Great! Thank you, Junio!

El mar., 29 oct. 2019 a las 4:03, Junio C Hamano ([off-list ref]) escribió:
Miriam Rubio [off-list ref] writes:
quoted
builtin/clone.c has a static function dir_exists() that
checks if a given path exists on the filesystem.  It returns
true (and it is correct for it to return true) when the
given path exists as a non-directory (e.g. a regular file).

This is confusing.  What the caller wants to check, and what
this function wants to return, is if the path exists, so
rename it to path_exists().

Signed-off-by: Miriam Rubio <redacted>
---
 builtin/clone.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
With a narrowed scope, the patch and its explanation are both
perfect ;-)

Now, with this localized change behind us, we may want to consider
what to do with file_exists(path) that does not ensure the path is a
file.  It would be a separate topic, and it is OK for the result
after such consideration to be "let's not go further for now".  It
also is OK for it to be "I am interested in digging further", too.

Thanks.  Will queue.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help