@@ -7,6 +7,15 @@ if [ -z "$UPSTREAM_REF" ]; then
77 echo " UPSTREAM_REF not set, defaulting to $UPSTREAM_REF "
88fi
99
10+ # Extract kernel version from UPSTREAM_REF (e.g., stable_6.12.y -> 6.12)
11+ KERNEL_VERSION=$( echo " $UPSTREAM_REF " | sed -E ' s/.*_([0-9]+\.[0-9]+)\.y/\1/' )
12+ if [ -z " $KERNEL_VERSION " ]; then
13+ echo " Failed to extract kernel version from UPSTREAM_REF: $UPSTREAM_REF "
14+ echo " Expected format: stable_X.Y.y (e.g., stable_6.12.y)"
15+ exit 1
16+ fi
17+ echo " Detected kernel version: $KERNEL_VERSION "
18+
1019git fetch --all
1120git show-ref --verify --quiet refs/remotes/origin/$UPSTREAM_REF
1221if [ $? -ne 0 ]; then
@@ -20,36 +29,36 @@ if [ $? -ne 0 ]; then
2029 exit 1
2130fi
2231
23- git show-ref --verify --quiet refs/heads/ciq-6.12 .y-next
24- if [ $? -eq 0 ]; then
25- echo " ciq-6.12 .y-next branch already exists, please check status of remote and local branches"
32+ git show-ref --verify --quiet refs/heads/ciq-${KERNEL_VERSION} .y-next
33+ if [ $? -eq 0 ]; then
34+ echo " ciq-${KERNEL_VERSION} .y-next branch already exists, please check status of remote and local branches"
2635 exit 1
2736fi
2837
29- git show-ref --verify --quiet refs/heads/{automation_tmp}_ciq-6.12 .y-next
30- if [ $? -eq 0 ]; then
31- echo " {automation_tmp}_ciq-6.12 .y-next branch already exists, please check status of remote and local branches"
38+ git show-ref --verify --quiet refs/heads/{automation_tmp}_ciq-${KERNEL_VERSION} .y-next
39+ if [ $? -eq 0 ]; then
40+ echo " {automation_tmp}_ciq-${KERNEL_VERSION} .y-next branch already exists, please check status of remote and local branches"
3241 exit 1
3342fi
3443
35- git checkout -b ciq-6.12 .y-next $UPSTREAM_REF
44+ git checkout -b ciq-${KERNEL_VERSION} .y-next $UPSTREAM_REF
3645if [ $? -ne 0 ]; then
37- echo " Failed to checkout ciq-6.12 .y-next, please check status of remote and local branches"
46+ echo " Failed to checkout ciq-${KERNEL_VERSION} .y-next, please check status of remote and local branches"
3847 exit 1
3948fi
40- git checkout ciq-6.12 .y
49+ git checkout ciq-${KERNEL_VERSION} .y
4150if [ $? -ne 0 ]; then
42- echo " Failed to checkout ciq-6.12 .y, please check status of remote and local branches"
51+ echo " Failed to checkout ciq-${KERNEL_VERSION} .y, please check status of remote and local branches"
4352 exit 1
4453fi
45- git checkout -b {automation_tmp}_ciq-6.12 .y-next
54+ git checkout -b {automation_tmp}_ciq-${KERNEL_VERSION} .y-next
4655if [ $? -ne 0 ]; then
47- echo " Failed to checkout {automation_tmp}_ciq-6.12 .y-next, please check status of remote and local branches"
56+ echo " Failed to checkout {automation_tmp}_ciq-${KERNEL_VERSION} .y-next, please check status of remote and local branches"
4857 exit 1
4958fi
50- git rebase ciq-6.12 .y-next
59+ git rebase ciq-${KERNEL_VERSION} .y-next
5160if [ $? -ne 0 ]; then
52- echo " Failed to rebase {automation_tmp}_ciq-6.12 .y-next, please check status of remote and local branches"
61+ echo " Failed to rebase {automation_tmp}_ciq-${KERNEL_VERSION} .y-next, please check status of remote and local branches"
5362 exit 1
5463fi
5564
0 commit comments