a4748a2aad0c57f3fab01d7bd2dcbe6be00263d2

Author
fred-o <fredrik.appelberg@gmail.com>
Committer
fred-o <fredrik.appelberg@gmail.com>
Date

Message

Merge branch 'master' of https://github.com/robbyrussell/oh-my-zsh

Diff

 1diff --git a/lib/git.zsh b/lib/git.zsh
 2index 4d1634e8bc52d0e71721c88e9017cbdc2cc2018b..fb4ad8ca64ffbf7bcfd34ca82b1acbe8947d36bf 100644
 3--- a/lib/git.zsh
 4+++ b/lib/git.zsh
 5@@ -4,15 +4,21 @@ function git_prompt_info() {
 6   echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
 7 }
 8 
 9+
10 # Checks if working tree is dirty
11 parse_git_dirty() {
12-  if [[ -n $(git status -s --ignore-submodules=dirty 2> /dev/null) ]]; then
13+  local SUBMODULE_SYNTAX=''
14+  if [[ $POST_1_7_2_GIT -gt 0 ]]; then
15+        SUBMODULE_SYNTAX="--ignore-submodules=dirty"
16+  fi
17+  if [[ -n $(git status -s ${SUBMODULE_SYNTAX}  2> /dev/null) ]]; then
18     echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
19   else
20     echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
21   fi
22 }
23 
24+
25 # Checks if there are commits ahead from remote
26 function git_prompt_ahead() {
27   if $(echo "$(git log origin/$(current_branch)..HEAD 2> /dev/null)" | grep '^commit' &> /dev/null); then
28@@ -61,4 +67,30 @@ git_prompt_status() {
29     STATUS="$ZSH_THEME_GIT_PROMPT_UNMERGED$STATUS"
30   fi
31   echo $STATUS
32-}
33+}
34+
35+#compare the provided version of git to the version installed and on path
36+#prints 1 if input version <= installed version
37+#prints -1 otherwise 
38+function git_compare_version() {
39+  local INPUT_GIT_VERSION=$1;
40+  local INSTALLED_GIT_VERSION
41+  INPUT_GIT_VERSION=(${(s/./)INPUT_GIT_VERSION});
42+  INSTALLED_GIT_VERSION=($(git --version));
43+  INSTALLED_GIT_VERSION=(${(s/./)INSTALLED_GIT_VERSION[3]});
44+
45+  for i in {1..3}; do
46+    if [[ $INSTALLED_GIT_VERSION[$i] -lt $INPUT_GIT_VERSION[$i] ]]; then
47+      echo -1
48+      return 0
49+    fi
50+  done
51+  echo 1
52+}
53+
54+#this is unlikely to change so make it all statically assigned
55+POST_1_7_2_GIT=$(git_compare_version "1.7.2")
56+#clean up the namespace slightly by removing the checker function
57+unset -f git_compare_version
58+
59+
60diff --git a/plugins/bundler/bundler.plugin.zsh b/plugins/bundler/bundler.plugin.zsh
61index 5e9b82336a0db3ee7ca0d8577dfc0c9f79943c5b..e1f571237a74f75d5522b073e8cdbfaa9efc502a 100644
62--- a/plugins/bundler/bundler.plugin.zsh
63+++ b/plugins/bundler/bundler.plugin.zsh
64@@ -6,7 +6,7 @@ alias bu="bundle update"
65 
66 # The following is based on https://github.com/gma/bundler-exec
67 
68-bundled_commands=(annotate cap capify cucumber ey foreman guard heroku middleman nanoc rackup rainbows rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails)
69+bundled_commands=(annotate cap capify cucumber ey foreman guard heroku middleman nanoc rackup rainbows rails rake rspec ruby shotgun spec spork thin thor unicorn unicorn_rails)
70 
71 ## Functions
72