X1011/git-directory-deploy — pull request #5 by txchen (2014-12-30 06:30:51+00:00)
Title: check if the deploy directory is empty or not

An empty deploy directory would generate unexpected results:
* It may wipe out gh-pages branch, usually we don't expect that.
* In a newly cloned repo, if the folder does not exist, script would
get error like:
fatal: This operation must be run in a work tree
The error is from line "git --work-tree "$deploy_directory" reset
--mixed --quiet"
* If remote branch does not exist, 'deploy.sh -s' would also get wrong
result.

To improve it, check if the directory is not empty in the beginning.