You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 11, 2020. It is now read-only.
If I have a repository at ~/foo, I can run git status in ~/foo/bar without a problem.
However, with any little tool that I write with this library, I use git.PlainOpen("."). This works fine if I'm at the root of the git repo, but quickly breaks down if I'm in any of its subdirectories.
I propose that a new Open variant be added that would iterate over the parent directories, stopping at the first containing a .git directory or file. This could be func PlainOpenDetect(from string) (*Repository, error), for example, to not have it depend on os.Getwd.
There's also the question of whether anyone would require the current PlainOpen versus this improved one. If the answer is not, perhaps the behavior of PlainOpen could simply be changed.
Happy to submit a patch with tests if this seems like a good idea.