From f2ab86f5bf36a648beb049989a12b93111145c4f Mon Sep 17 00:00:00 2001 From: Alex Palaistras Date: Sat, 29 Oct 2022 11:25:23 +0100 Subject: [PATCH] hugo: Clone with `depth=1`, reset after fetch --- service/hugo/container/config/deploy.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/service/hugo/container/config/deploy.sh b/service/hugo/container/config/deploy.sh index 0392b11..46c35d8 100755 --- a/service/hugo/container/config/deploy.sh +++ b/service/hugo/container/config/deploy.sh @@ -22,9 +22,9 @@ export GIT_SSH_COMMAND if test -d "$GIT_DIR_NAME"; then cd "$GIT_DIR_NAME" - git fetch origin "$GIT_BRANCH" + git fetch origin "$GIT_BRANCH" && git reset --hard "$GIT_BRANCH" else - git clone --branch "$GIT_BRANCH" -- "$GIT_REPO_URL" "$GIT_DIR_NAME" + git clone --depth 1 --branch "$GIT_BRANCH" -- "$GIT_REPO_URL" "$GIT_DIR_NAME" cd "$GIT_DIR_NAME" fi