[CLI] `bb login` fails in `git-worktree` linked worktrees.
asford opened this issue · comments
The bb login
command fails when using a git worktree,
because git worktree
replaces the .git
directory with a file-based pointer to the worktree root in linked worktrees.
$ bazel login
Enter your API key from https://app.buildbuddy.io/settings/cli-login: $SEKRAT
failed to write API key to local .git/config: failed to determine git repo root: "/absolute/path/to/worktree_checkout/.git" is not a directory
$ bazel version
Bazelisk version: v1.19.0
bb 5.0.25
Build label: 5.4.0
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Dec 15 16:14:25 2022 (1671120865)
Build timestamp: 1671120865
Build timestamp as int: 1671120865
$ cat .git
gitdir: /absolute/path/to/main/.git/worktrees/worktree_checkout
$ git rev-parse --git-dir
/absolute/path/to/main/.git/worktrees/worktree_checkout
@asford We have created a new CLI release https://github.com/buildbuddy-io/bazel/releases/tag/5.0.44 that includes the fix.
Could you please update your CLI and try using it against your git-worktree checkout?