From 6b8c3642bd087d4bf2cc371dc669e4557a0eeaa0 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 15 Jan 2017 15:40:25 +0100 Subject: [PATCH] apidoc: improvements to its Git magic (#1399) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - use `--depth 1` with git-clone for faster checkout/cloning - use `-B` with git-checkout > If -B is given, is created if it doesn’t exist; > otherwise, it is reset. This is the transactional equivalent of > > $ git branch -f [] > $ git checkout --- build-utils/travis-apidoc.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build-utils/travis-apidoc.sh b/build-utils/travis-apidoc.sh index d1638f9a..e3bfb57b 100755 --- a/build-utils/travis-apidoc.sh +++ b/build-utils/travis-apidoc.sh @@ -32,7 +32,7 @@ export GIT_AUTHOR_EMAIL="awesome-robot@users.noreply.github.com" export GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME" export GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL" -git clone --branch gh-pages "$REPO_APIDOC" build/apidoc \ +git clone --depth 1 --branch gh-pages "$REPO_APIDOC" build/apidoc \ 2>&1 | sed "s/$GH_APIDOC_TOKEN/GH_APIDOC_TOKEN/g" cd build/apidoc @@ -50,7 +50,7 @@ else BRANCH="gh-pages" fi if [ "$BRANCH" != "gh-pages" ]; then - git checkout -b "$BRANCH" "origin/${BRANCH}" || git checkout -b "$BRANCH" + git checkout -B "$BRANCH" "origin/${BRANCH}" fi # Use a temporary branch for the two commits, which allows for a better UI.