zhan7236 opened a new pull request, #36924:
URL: https://github.com/apache/beam/pull/36924
The `beam-linkage-check.sh` script fails to restore the original git
position when starting from a detached HEAD state. This commonly happens when
verifying someone else's PR, which involves merging two non-branch references.
**Root Cause:**
The script used `git rev-parse --abbrev-ref HEAD` which returns the string
"HEAD" in detached state instead of a valid reference. The cleanup function
then fails to restore the original position.
**Fix:**
- Use `git rev-parse HEAD` to get the full commit SHA instead of branch name
- Add `-c advice.detachedHead=false` to suppress warnings during cleanup
checkout
Fixes #20558
------------------------
Thank you for your contribution! Follow this checklist to help us
incorporate your contribution quickly and easily:
- [x] Mention the appropriate issue in your description (for example:
`addresses #123`), if applicable. This will automatically add a link to the
pull request in the issue. If you would like the issue to automatically close
on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
- [ ] Update `CHANGES.md` with noteworthy changes.
- [ ] If this contribution is large, please file an Apache [Individual
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
--
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]