aw-was-here commented on a change in pull request #138:
URL: https://github.com/apache/yetus/pull/138#discussion_r496209004



##########
File path: precommit/src/main/shell/test-patch.sh
##########
@@ -1288,14 +1288,19 @@ function git_checkout
       # protected by OFFLINE == false
 
       if [[ "${GIT_OFFLINE}" == false ]]; then
-        if ! "${GIT}" fetch; then
-          yetus_error "ERROR: git fetch is failing"
-          cleanup_and_exit 1
-        fi
 
-        if ! "${GIT}" reset --hard FETCH_HEAD; then
-          yetus_error "ERROR: git reset is failing"
-          cleanup_and_exit 1
+        # if it is a tag, then the pull rebase should have done
+        # the trick already
+        if [[ ! -f ".git/refs/tags/${PATCH_BRANCH}" ]]; then

Review comment:
       The problem arises almost entirely in `--empty-patch` mode aka `qbt` 
mode.  In that case `PATCH_BRANCH` is going to be whatever has been requested 
to get built: main, branch-2.0, or rel/0.12.0. For example, we hit this bug 
every time we cut a release because `test-patch` runs on all pushes (which 
includes branch and tag creations).




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

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


Reply via email to