Skip to content

Commit

Permalink
bin/buck should only invoke git if a .git directory is present.
Browse files Browse the repository at this point in the history
Test Plan: Manual testing.
bolinfest committed May 2, 2013
1 parent 2c58bb9 commit 0aef2e5
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions bin/buck
Original file line number Diff line number Diff line change
@@ -74,16 +74,21 @@ if [ ! -e "build/buck.jar" ]; then
exit $?
fi

# Make sure buck gets passed the right version.
BUCK_CURRENT_VERSION=`git rev-parse HEAD`

# if the output of git status -s is non-empty (-n test), it means there are changed files.
if [ -n "`git status -s`" ]; then
BUCK_REPOSITORY_DIRTY=1
BUCK_REPOSITORY_DIRTY=0
if [ -d ".git" ]; then
# Make sure buck gets passed the right version.
BUCK_CURRENT_VERSION=`git rev-parse HEAD`

if [ -n "`git status -s`" ]; then
BUCK_REPOSITORY_DIRTY=1
fi
else
BUCK_REPOSITORY_DIRTY=0
BUCK_CURRENT_VERSION="UNKNOWN"
fi


# Pop back to the original directory.
popd > /dev/null
popd > /dev/null

0 comments on commit 0aef2e5

Please sign in to comment.