]> git.madduck.net Git - etc/zsh.git/blobdiff - .zsh/zshrc/85_git_prompt

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

noglob for browsers
[etc/zsh.git] / .zsh / zshrc / 85_git_prompt
index 9d05ccae609f8917a7875ae1cd11244c53e8a873..626b4c374e65733104d908b825b3be7c23789c2d 100644 (file)
@@ -15,14 +15,14 @@ _get_git_cur_branch() {
 }
 
 _is_git_repo() {
 }
 
 _is_git_repo() {
-  [ $(git rev-parse --is-inside-work-tree) = true ]
+  [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = true ]
 }
 
 _set_git_psvar() {
   if _is_git_repo; then
     psvar[1]="$(_get_git_cur_branch)"
   else
 }
 
 _set_git_psvar() {
   if _is_git_repo; then
     psvar[1]="$(_get_git_cur_branch)"
   else
-    unset "psvar[1]"
+    [ -n "$psvar[1]" ] && unset "psvar[1]"
   fi
 }
 
   fi
 }