Commit be1ca115 authored by Stan Hu's avatar Stan Hu

Apply suggestion to support/self-update-git-worktree

parent f661f0d7
Pipeline #64609129 failed with stages
in 44 minutes and 23 seconds
......@@ -6,18 +6,16 @@ def run(cmd)
ci_project_dir = ENV['CI_PROJECT_DIR']
ci_sha = ENV.fetch('CI_COMMIT_SHA', '')
ci_sha = ENV['CI_COMMIT_SHA']
# We need to retrieve the commit SHA if the source project is a fork
if ci_project_dir && !ci_sha.empty?
if ci_project_dir && ci_sha
run(%W[git remote add source #{ci_project_dir}])
run(%W[git fetch source #{ci_sha}])
cmd = if ci_sha.empty?
%w[git merge --ff-only origin/master]
if ci_sha
run(%w[git merge --ff-only origin/master])
%W[git checkout #{ci_sha}]
run(%W[git checkout #{ci_sha}])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment