Repository: incubator-griffin-site Updated Branches: refs/heads/master 135a926e5 -> 526fdd63d
fix bug Project: http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/commit/526fdd63 Tree: http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/tree/526fdd63 Diff: http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/diff/526fdd63 Branch: refs/heads/master Commit: 526fdd63d782a78045a73a54ed68c3e4330758fe Parents: 135a926 Author: William Guo <gu...@apache.org> Authored: Thu Sep 13 10:13:18 2018 +0800 Committer: William Guo <gu...@apache.org> Committed: Thu Sep 13 10:13:18 2018 +0800 ---------------------------------------------------------------------- deploy.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-griffin-site/blob/526fdd63/deploy.sh ---------------------------------------------------------------------- diff --git a/deploy.sh b/deploy.sh index 1fc9bad..5851f15 100644 --- a/deploy.sh +++ b/deploy.sh @@ -24,12 +24,15 @@ else exit 1 fi -# Delete local $SITE branch and recreate it. -git branch -D $SITE > /dev/null 2>&1 -git checkout -b $SITE > /dev/null 2>&1 -git add --all . -git commit -m "Initial commit" > /dev/null 2>&1 -echo "delete $SITE branch , and recreate empty one" +# Switch to the SITE branch +git checkout $SITE > /dev/null 2>&1 +if [ $? = 1 ]; then + # Branch does not exist. Create an orphan branch. + git checkout -b $SITE > /dev/null 2>&1 + git add --all . + git commit -m "Initial commit" > /dev/null 2>&1 + echo "$SITE branch does not exist, create new branch $SITE" +fi # Remove the current contents of the SITE branch and # replace them with the contents of the temp folder