Skip to content

[Bug]: Started with GIT_DIR set, T3 Code shows another repository's branch in my project #35099

Closed

Description

@only21mil

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Make two repositories:
    git init -b main demo-project && cd demo-project
    echo "# Demo project" > README.md && git add README.md && git commit -m "Initial commit"
    git switch -c feature/demo-project && cd ..
    git init -b main inherited-other && cd inherited-other
    echo "# Other repository" > OTHER.md && git add OTHER.md && git commit -m "Other initial commit"
    git switch -c wrong-repository-branch && cd ..
  2. Start the T3 Code server with GIT_DIR pointing at the second repository, as it is when the server is started from a Git hook (Git exports GIT_DIR to hook scripts). From a source checkout: GIT_DIR=/path/to/inherited-other/.git vp run dev.
  3. Add demo-project as a project (Add project > Local folder) and look at the thread details panel and its branch picker.

Expected behavior

demo-project shows its own branch, feature/demo-project, and no changes. That is what the same steps show when the server starts without GIT_DIR.

Actual behavior

demo-project shows the branch wrong-repository-branch, and its branch picker lists wrong-repository-branch (current) and main, the branches of inherited-other. Changes shows +1 -1 although demo-project has no changes.

Impact

Minor bug or occasional failure

Version or commit

main, commit b68aedf

Environment

Linux, web client in Chromium, dev server from source with a fresh home, Node 26.12.1, git 2.53.

Logs or stack traces

Screenshots, recordings, or supporting files

main b68aedf: started with GIT_DIR set, demo-project shows wrong-repository-branch and the other repository branches
main b68aedf: started with GIT_DIR set, demo-project shows wrong-repository-branch and the other repository branches

Workaround

Unset GIT_DIR before starting T3 Code.

A fix is in #28795.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions