gemini-code-assist[bot] commented on code in PR #19775:
URL: https://github.com/apache/tvm/pull/19775#discussion_r3410913760


##########
ci/jenkins/templates/utils/Prepare.groovy.j2:
##########
@@ -44,15 +47,16 @@ def update_upstream_revision(git_ref) {
   }
 }
 
-def merge_with_main() {
+def merge_with_target() {
+  def target = env.CHANGE_TARGET
   sh (
-    script: 'git fetch origin main',
-    label: 'Fetch upstream',
+    script: "git fetch origin ${target}",
+    label: "Fetch target branch ${target}",
   )

Review Comment:
   ![medium](https://www.gstatic.com/codereviewagent/medium-priority.svg)
   
   To prevent potential shell expansion or word splitting issues if the target 
branch name contains special characters (such as spaces or other shell 
metacharacters), it is safer to wrap the target branch variable in single 
quotes within the shell script. Note that after applying this change to the 
template, the Jenkinsfiles should be regenerated.
   
   ```
   def merge_with_target() {
     def target = env.CHANGE_TARGET
     sh (
       script: "git fetch origin '${target}'",
       label: "Fetch target branch ${target}",
     )
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to