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 1
1
[submodule "os/freertos "]
2
2
path = os/freertos
3
3
url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git
4
+ shallow = true
Original file line number Diff line number Diff line change 51
51
echo " Clone repo from ${REPO_LINK} at commit or tag ${REPO_COMMIT} "
52
52
git init .
53
53
git 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
+
72
60
git checkout -b embARC ${REPO_COMMIT}
73
61
echo " Try to apply patch for this repo"
74
62
git am * .patch
You can’t perform that action at this time.
0 commit comments