Kaynağa Gözat

Move git version string into git.sh

This way, the file can now be used independently in other places.
cinaeco 5 yıl önce
ebeveyn
işleme
7903a8d17d
2 değiştirilmiş dosya ile 2 ekleme ve 4 silme
  1. 2 0
      shell/common/git.sh
  2. 0 4
      shell/common/vars

+ 2 - 0
shell/common/git.sh

@@ -27,6 +27,8 @@ alias gs='git status'
 alias gsr='git show --format=raw' # all info about a commmit.
 
 # Git log (`gl`). Displays graph, decorations, users and dates.
+GIT_VER=$(git --version 2>/dev/null)
+GIT_VER=${GIT_VER:12:5}
 [[ $(version-compare $GIT_VER "1.8.3") -ge 0 ]] && DECO_COLOUR='%C(auto)' || DECO_COLOUR='%Cgreen'
 GL_PRETTY="'format:%C(yellow)%h %Creset%ad %Cblue%an:$DECO_COLOUR%d %Creset%s'"
 GL_OPTS="--graph --date=short --pretty=$GL_PRETTY"

+ 0 - 4
shell/common/vars

@@ -2,7 +2,3 @@
 # Variables that other common shell scripts rely on.
 
 TERM="xterm-256color"
-
-# Git version string
-GIT_VER=$(git --version 2>/dev/null)
-GIT_VER=${GIT_VER:12:5}