Skip to content

Should isAGitDirectory be public? #524

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

Closed
samskiter opened this issue Oct 8, 2015 · 5 comments
Closed

Should isAGitDirectory be public? #524

samskiter opened this issue Oct 8, 2015 · 5 comments

Comments

@samskiter
Copy link

I can't find any use of it. Should it be a public class method of GTRepository?

@joshaber
Copy link
Member

joshaber commented Oct 8, 2015

Hah, yeah, and it's almost certainly gonna be wrong in a lot of situations. A PR to 🔥 it would be great 😄

@samskiter
Copy link
Author

Ah I see. It's an old method. it's not currently public, i just wondered if it should be as it could be pretty useful

@joshaber
Copy link
Member

joshaber commented Oct 9, 2015

It seems likely that libgit2 has some function like that that we should use instead.

@pietbrauer
Copy link
Member

What I did in my app is to check if [GTRepository initWithURL:error:] and check for the libgit2 error which is returned if it is not a repository. I tried both ways, the isAGitDirectory check and checking for the error, they both result in the same behaviour.

@joshaber
Copy link
Member

Yeah, I'd expect -initWithURL:error: to be more future-safe.

pietbrauer added a commit that referenced this issue Oct 21, 2015
As discussed in #524 it
is not public and `[GTRepository initWithURL:error:]` should be more
future safe.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants