File tree Expand file tree Collapse file tree 2 files changed +7
-18
lines changed Expand file tree Collapse file tree 2 files changed +7
-18
lines changed Original file line number Diff line number Diff line change 11[submodule "os/freertos "]
22 path = os/freertos
33 url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git
4+ shallow = true
Original file line number Diff line number Diff line change 5151echo " Clone repo from ${REPO_LINK} at commit or tag ${REPO_COMMIT} "
5252git init .
5353git remote add origin ${REPO_LINK}
54- git fetch origin -t
55- git_branch=($( git branch -a| grep ' remotes' | sed -e ' s/^[[:space:]]*remotes\///' ) )
56- if [ " x${git_branch[0]} " == " x" ] ; then
57- echo " Fetch tag failed, just fetch all the source code"
58- git fetch origin
59- git_branch=($( git branch -a| grep ' remotes' | sed -e ' s/^[[:space:]]*remotes\///' ) )
60- fi
61- if [ " x${git_branch[0]} " == " x" ] ; then
62- echo " No branch found in the remote repo, patch failed"
63- rm -rf .git
64- exit_proc 1
65- fi
66- git checkout -b master ${git_branch[0]}
67- git log --pretty -1 ${REPO_COMMIT}
68- if [[ ! $? -eq 0 ]] ; then
69- echo " No commit related to ${REPO_COMMIT} , try to fetch more from remote"
70- git fetch --depth 3000
71- fi
54+ git fetch --depth 1 origin refs/tags/${REPO_COMMIT} :refs/tags/${REPO_COMMIT} || {
55+ echo " Fetch tag failed, try default branch"
56+ default_branch=$( git remote show ${REPO_LINK} | sed -n " s/^.*HEAD branch: \(.*\)$/\1/p" )
57+ git fetch origin ${default_branch}
58+ }
59+
7260git checkout -b embARC ${REPO_COMMIT}
7361echo " Try to apply patch for this repo"
7462git am * .patch
You can’t perform that action at this time.
0 commit comments