Skip to content

Commit 45735a1

Browse files
The clone script is modified to delete (if any) an existing old mcp_main before push
1 parent 7400603 commit 45735a1

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

mcp_git_clone.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,26 @@ mcp_branch="mcp_main"
370370
git checkout -b $mcp_branch
371371

372372

373+
#=============== A temporary hack ===============
374+
375+
# As of git version 2.40.1 and for Unity-ADS Auto Clone/Build process,
376+
# the 'git push --force ...' command above for main/master branch works,
377+
# but 'git push --force ...' command below for mcp-main branch does not
378+
# work. However, both forced push commands do work with git version
379+
# 2.44.0. No test has been done with git versions 2.42.x and 2.43.x.
380+
# Currently (03/11/2024), the git version supported in Amazon Linux
381+
# environment is 2.40.1. It is expected that when Amazon Linux starts
382+
# to use git version 2.44.0 and above, the following code block, which
383+
# deletes remote MCP-main branch, can be deleted or commented out.
384+
385+
deleted=$(! git push "$name" -d "$mcp_branch" > /dev/null 2>&1; echo $?)
386+
if (( $deleted )); then
387+
echo "INFO: Successfully deleted an old $mcp_branch branch at MCP GitLab."
388+
else
389+
echo "INFO: Did not detect an old $mcp_branch branch at MCP GitLab to delete."
390+
fi
391+
392+
373393
#=============== Add pipeline YAML file if given. ===============
374394

375395
# If pipeline yml file provided, copy it to destination. Here, we

0 commit comments

Comments
 (0)