gnachman / iterm2-website

Website for iTerm2
http://iterm2.com/
GNU General Public License v2.0
80 stars 66 forks source link

it2git: short-circuit if we are not in a git repo. #60

Closed sshimko closed 5 years ago

sshimko commented 5 years ago

Check to see if PWD is in a git repo before running subsequent commands that are only useful within a git repo.

sshimko commented 5 years ago

Now that I think about it - should this explicitly clear out the git* user variables when git rev-parse returns an error indicating you aren't in a git repo?

sshimko commented 5 years ago

The pushed update seems to work as expected and clears out the variables. Specifically, I noticed issues when SSH'ing from a local git repo to a remote host outside of a git repo. In the previous version of this patch the status bar still reflected the git repo information from the local host.

gnachman commented 5 years ago

Some day I will understand rev-parse, but it may require ascending to a higher state of being. Thank you for the fix!