aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2016-02-09 21:18:03 +0300
committerBen Hilburn <bhilburn@gmail.com>2016-02-09 21:18:03 +0300
commit2d196fa12ffcd579ea310ad676aac9af51e360b2 (patch)
tree102280109d609c4ac4cc41fe642613b6e0274145
parent1a05542901d32ef897090915f0daee7d2300eb42 (diff)
parent52982e3f63133b528714e65e35b4a44d438ef1ce (diff)
Merge pull request #211 from Falkor/feature/better_dirty_check
VCS dirty check even in subdirs
-rw-r--r--functions/vcs.zsh6
1 files changed, 5 insertions, 1 deletions
diff --git a/functions/vcs.zsh b/functions/vcs.zsh
index b23b8330..3eec5dfd 100644
--- a/functions/vcs.zsh
+++ b/functions/vcs.zsh
@@ -7,8 +7,12 @@
################################################################
function +vi-git-untracked() {
+ local FLAGS
+ FLAGS=('--porcelain')
+ # TODO: check git >= 1.7.2 - see function git_compare_version()
+ FLAGS+='--ignore-submodules=dirty'
if [[ $(git rev-parse --is-inside-work-tree 2> /dev/null) == 'true' && \
- -n $(git ls-files --others --exclude-standard | sed q) ]]; then
+ -n $(git status ${FLAGS} | grep '^??' 2> /dev/null | tail -n1) ]]; then
hook_com[unstaged]+=" %F{$POWERLEVEL9K_VCS_FOREGROUND}$(print_icon 'VCS_UNTRACKED_ICON')%f"
VCS_WORKDIR_HALF_DIRTY=true
else