|  | 
| 63 | 63 |     exit 1 | 
| 64 | 64 | fi | 
| 65 | 65 | 
 | 
| 66 |  | -msg=`git log -1 --pretty=%B` | 
|  | 66 | +# make sure there aren't untracked files that will get uploaded to the website | 
|  | 67 | +UNTRACKED_FILES=$(git ls-files --others --exclude-standard) | 
|  | 68 | +if [ -n "${UNTRACKED_FILES}" ] ; then | 
|  | 69 | +    echo "Error: Untracked files.  Please commit or stash before updating master." | 
|  | 70 | +    exit 1 | 
|  | 71 | +fi | 
| 67 | 72 | 
 | 
| 68 |  | -echo "Checking out source" | 
| 69 |  | -git checkout source | 
| 70 |  | -echo | 
|  | 73 | +# make sure the source branch is up-to-date with origin/source | 
|  | 74 | +echo "Fetching content from remote" | 
|  | 75 | +git fetch --quiet origin | 
| 71 | 76 | 
 | 
| 72 |  | -echo "Pulling updates to the source" | 
| 73 |  | -git pull --quiet origin source | 
| 74 |  | -echo | 
|  | 77 | +COUNT_MISSING="$(git rev-list --count source..origin/source)" | 
|  | 78 | +if [ "${COUNT_MISSING}" != 0 ] ; then | 
|  | 79 | +    echo "Error: the 'source' branch is not up-to-date.  Please do a 'git pull'" | 
|  | 80 | +    exit 1 | 
|  | 81 | +fi | 
|  | 82 | + | 
|  | 83 | +COUNT_EXTRA="$(git rev-list --count origin/source..source)" | 
|  | 84 | +if [ "${COUNT_EXTRA}" != 0 ] ; then | 
|  | 85 | +    echo "Error: the 'source' branch contains changes that have not been merged!" | 
|  | 86 | +    echo | 
|  | 87 | +    echo "    Please create a PR for these changes. After the PR is merged, " | 
|  | 88 | +    echo "    please pull from the source branch and run the ./deploy.sh script again." | 
|  | 89 | +    exit 1 | 
|  | 90 | +fi | 
| 75 | 91 | 
 | 
| 76 |  | -# fetch master | 
| 77 |  | -echo "Pulling master" | 
|  | 92 | +# Check out master in _site | 
|  | 93 | +echo "Checking out master in _site" | 
| 78 | 94 | ( | 
| 79 | 95 |     cd _site | 
| 80 | 96 |     git checkout --quiet master | 
| 81 |  | -    git fetch --quiet origin | 
| 82 | 97 |     git reset --quiet --hard origin/master | 
| 83 | 98 | 
 | 
| 84 | 99 |     # update the documentation? | 
|  | 
| 106 | 121 | # deploy master | 
| 107 | 122 | ( | 
| 108 | 123 |     cd _site | 
|  | 124 | +    msg=`git log -1 --pretty=%B` | 
| 109 | 125 | 
 | 
| 110 | 126 |     # check if there are any changes on master | 
| 111 | 127 |     untracked=`git ls-files --other --exclude-standard --directory` | 
|  | 
0 commit comments