Skip to content

Commit

Permalink
add env variable for showing of untracked files
Browse files Browse the repository at this point in the history
  • Loading branch information
Arne Schmitz committed Dec 2, 2015
1 parent 6a606da commit 4f2bc5c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions gitstatus.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env bash
# -*- coding: UTF-8 -*-
# -*- coding: utf-8 -*-
# gitstatus.sh -- produce the current git repo status on STDOUT
# Functionally equivalent to 'gitstatus.py', but written in bash (not python).
#
Expand All @@ -15,7 +15,11 @@ if [ -z "${__GIT_PROMPT_DIR}" ]; then
__GIT_PROMPT_DIR="$( cd -P "$( dirname "${SOURCE}" )" && pwd )"
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
[[ "$?" -ne 0 ]] && exit 0
Expand Down

0 comments on commit 4f2bc5c

Please sign in to comment.