zhouyuan commented on code in PR #8682:
URL: https://github.com/apache/incubator-gluten/pull/8682#discussion_r1946582581


##########
ep/build-velox/src/get_velox.sh:
##########
@@ -150,18 +150,23 @@ TARGET_BUILD_COMMIT="$(git ls-remote $VELOX_REPO 
$VELOX_BRANCH | awk '{print $1;
 if [ -d $VELOX_SOURCE_DIR ]; then
   echo "Velox source folder $VELOX_SOURCE_DIR already exists..."
   cd $VELOX_SOURCE_DIR
-  git init .
-  EXISTS=$(git show-ref refs/tags/build_$TARGET_BUILD_COMMIT || true)
-  if [ -z "$EXISTS" ]; then
-    git fetch $VELOX_REPO 
$TARGET_BUILD_COMMIT:refs/tags/build_$TARGET_BUILD_COMMIT
+  # if velox_branch exists, check it out, 
+  # otherwise assume that user prepared velox source in velox_home, skip 
checkout
+  if [ -n "$TARGET_BUILD_COMMIT" ]; then
+    git init .
+    EXISTS=$(git show-ref refs/tags/build_$TARGET_BUILD_COMMIT || true)
+    if [ -z "$EXISTS" ]; then
+      git fetch $VELOX_REPO 
$TARGET_BUILD_COMMIT:refs/tags/build_$TARGET_BUILD_COMMIT
+    fi
+    git reset --hard HEAD
+    git checkout refs/tags/build_$TARGET_BUILD_COMMIT
   fi
-  git reset --hard HEAD
-  git checkout refs/tags/build_$TARGET_BUILD_COMMIT
 else
   git clone $VELOX_REPO -b $VELOX_BRANCH $VELOX_SOURCE_DIR
   cd $VELOX_SOURCE_DIR
   git checkout $TARGET_BUILD_COMMIT
 fi

Review Comment:
   nit: better to print some warning message here?



-- 
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