Closed jonathantneal closed 6 years ago
This fixes the problem without introducing dependencies. Why did you close it?
Hi @jonathantneal, thanks for the pull request, but I didn't merge since it was a duplicate of #3.
This fixes the problem without introducing dependencies. Why did you close it?
Can you clarify? Do you mean, why did I merge the PR that was before yours? Or why did I merge it instead of yours, since yours didn't introduce dependencies?
@jonschlinkert, the misunderstanding is mine. I made this PR initially unaware of the other one.
However, I was still thinking this PR was worth adding because it did not add dependencies to an otherwise dependency-less project, and it kept the asynchronous call asynchronous.
The method of detection that I added is fairly common, and is used in other similar libraries — for example https://github.com/soldair/node-gitconfiglocal/blob/master/index.js#L41-L48 (while the code is hardly 1:1, note that it’s the exact same strategy)
I was hoping to run git-branch from a subdirectory and saw that it couldn’t look up a directory. This PR fixes that.