Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reconcile dir_exists() and is_directory() #230

Open
dscho opened this issue May 28, 2019 · 2 comments · May be fixed by #271
Open

Reconcile dir_exists() and is_directory() #230

dscho opened this issue May 28, 2019 · 2 comments · May be fixed by #271
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@dscho
Copy link
Member

dscho commented May 28, 2019

In https://github.com/git/git/blob/v2.22.0-rc1/builtin/clone.c#L885-L889, there is a function with the short and sweet name dir_exists() (which is the obvious companion to file_exists()). However, it is marked as static, so nobody can use it outside builtin/clone.c.

There is also is_directory() which obviously tries to do the very same, but it uses a name that few developers will think of when they see file_exists() and look for the equivalent function to see whether a given directory exists.

Let's reconcile these, probably by renaming is_directory() to dir_exists() and using it also in builtin/clone.c.

@dscho dscho added enhancement New feature or request good first issue Good for newcomers labels May 28, 2019
@r1walz
Copy link

r1walz commented May 28, 2019

Let's reconcile these, probably by renaming is_directory() to dir_exists() and using it also in builtin/clone.c.

Maybe moving it to dir.c and renaming in builtin/clone.c?

@dscho
Copy link
Member Author

dscho commented May 29, 2019

Maybe moving it to dir.c and renaming in builtin/clone.c?

I don't think so, as the current dir_exists() does not verify that the path refers to a directory. In essence, it actually does more of a path_exists().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants