Merge pull request #4043 from tianon/hack-git-detection-and-use

Add better ".git" detection and use
This commit is contained in:
Tianon Gravi 2014-02-13 09:56:14 -07:00
commit f794fbc230
1 changed files with 2 additions and 2 deletions

View File

@ -53,9 +53,9 @@ DEFAULT_BUNDLES=(
)
VERSION=$(cat ./VERSION)
if [ -d .git ] && command -v git &> /dev/null; then
if command -v git &> /dev/null && git rev-parse &> /dev/null; then
GITCOMMIT=$(git rev-parse --short HEAD)
if [ -n "$(git status --porcelain)" ]; then
if [ -n "$(git status --porcelain --untracked-files=no)" ]; then
GITCOMMIT="$GITCOMMIT-dirty"
fi
elif [ "$DOCKER_GITCOMMIT" ]; then