Merge pull request #16196 from yongtang/15957-branch-switch

Fix issue of branch switching not working with bazel