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

git info doesn't work in subdirectories #14

Open
nfischer opened this issue Sep 7, 2017 · 1 comment
Open

git info doesn't work in subdirectories #14

nfischer opened this issue Sep 7, 2017 · 1 comment

Comments

@nfischer
Copy link

nfischer commented Sep 7, 2017

Steps to repro:

~ mkdir dummy-repo
➜ ~ cd dummy-repo/
➜ dummy-repo git init
Initialized empty Git repository in /usr/local/google/home/ntfschr/dummy-repo/.git/
➜ dummy-repo git:(null) mkdir sub/
➜ dummy-repo git:(null) cd sub/
➜ sub

Expected results:

I would expect the last line to say:

➜ sub git:(null)

Screenshot:

Your fork:
robbyrussell-subdirectory

The original robbyrussell zsh theme:
robbyrussell-real

(I'm not including all of oh-my-zsh, so the colors and symbols are off, but the git stuff works as expected)


Also, any reason why you're returning null for a fresh branch instead of master? Not sure if this is intentional or not.

@denysdovhan
Copy link
Owner

Seems like git-state checks only if the current directory is git repo and doesn't work for subdirectories:

https://github.com/watson/git-state/blob/master/index.js#L15-L23

Not OK.

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

2 participants