From bc380c73eef970e57195159a654edd2b14fb633b Mon Sep 17 00:00:00 2001 From: Jeff Wong Date: Thu, 10 Dec 2020 15:53:58 -1000 Subject: [PATCH] FIX: Run reset and clean after checkout (#500) shallow fetching and resetting may result in a dirty working tree. Ensure we have a clean working tree by running the reset and clean after the fetch. Previously, we needed the clean and reset before the PULL, to ensure a clean pull, but since we are using fetch + checkout (which does not result in a merge if dirty) we might end up with a dirty repo after the checkout, such as if a clone remote has a different master branch than core. --- templates/web.template.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/web.template.yml b/templates/web.template.yml index 28fb22d..0c64e15 100644 --- a/templates/web.template.yml +++ b/templates/web.template.yml @@ -86,12 +86,12 @@ run: cd: $home hook: code cmd: - - git reset --hard - - git clean -f - git remote set-branches --add origin master - git remote set-branches origin $version - git fetch --depth 1 origin $version - git checkout $version + - git reset --hard origin $version + - git clean -f - mkdir -p tmp - chown discourse:www-data tmp - mkdir -p tmp/pids -- 2.25.1