add env variable for showing of untracked files

master
Arne Schmitz 10 years ago
parent 6a606da7c0
commit 4f2bc5cadf
  1. 8
      gitstatus.sh

@ -1,5 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
# -*- coding: UTF-8 -*- # -*- coding: utf-8 -*-
# gitstatus.sh -- produce the current git repo status on STDOUT # gitstatus.sh -- produce the current git repo status on STDOUT
# Functionally equivalent to 'gitstatus.py', but written in bash (not python). # Functionally equivalent to 'gitstatus.py', but written in bash (not python).
# #
@ -15,7 +15,11 @@ if [ -z "${__GIT_PROMPT_DIR}" ]; then
__GIT_PROMPT_DIR="$( cd -P "$( dirname "${SOURCE}" )" && pwd )" __GIT_PROMPT_DIR="$( cd -P "$( dirname "${SOURCE}" )" && pwd )"
fi fi
gitstatus=$( LC_ALL=C git status --untracked-files=all --porcelain --branch ) if [ -z "${GIT_SHOW_UNTRACKED_FILES}" ]; then
GIT_SHOW_UNTRACKED_FILES="all"
fi
gitstatus=$( LC_ALL=C git status --untracked-files=${GIT_SHOW_UNTRACKED_FILES} --porcelain --branch )
# if the status is fatal, exit now # if the status is fatal, exit now
[[ "$?" -ne 0 ]] && exit 0 [[ "$?" -ne 0 ]] && exit 0

Loading…
Cancel
Save