+ if [ x"${init_cmd}" != x"" ]; then
+ sed -i -e "s@.*INIT_CMD@${init_cmd}@" ${compile_script}
+ fi
+ sed -i -e "s@COMPILE_CMD@${compile_cmd}@" ${compile_script}
+ chmod u+x ${compile_script}
+
+ # Create temporary branch for compilation, based on compile_branch:
+ temp_compile_branch="${patches_branch}_compile"
+
+ if git branch | grep -q ${temp_compile_branch}; then
+ git branch -D ${temp_compile_branch}
+ fi
+
+ git checkout -b ${temp_compile_branch} ${compile_branch}
+
+ # Apply all of our commits to temp_compile_branch:
+ git cherry-pick ${COMMIT_START_SHA1}..${COMMIT_END_SHA1}
+
+ # Compile and test each commit:
+ git rebase --exec=${compile_script} ${compile_branch}