{"thread":{"id":"62422","subject":"Opening git-bash from git-gui and cd'ing to the root of the filesystem results in git-bash thinking it is at the top-level of the repo","startedAt":"2024-10-28T20:20:11Z","lastAt":"2024-10-28T20:20:11Z","messageCount":1,"participants":["Kevin Navero"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"506255","messageId":"CACRG6_ApLKqnVrvQziUtF4nkquk_HPiXTMR-NDdx85BSN1ng4g@mail.gmail.com","threadId":"62422","inReplyTo":null,"subject":"Opening git-bash from git-gui and cd'ing to the root of the filesystem results in git-bash thinking it is at the top-level of the repo","fromName":"Kevin Navero","fromEmail":"knavero@gmail.com","sentAt":"2024-10-28T20:19:57Z","receivedAt":"2024-10-28T20:20:11Z","isPatch":false,"sender":{"key":"knavero@gmail.com","avatar":null},"body":"Hi,\n\nGenerated this bug report using git-bugreport:\n\nThank you for filling out a Git bug report!\nPlease answer the following questions to help us understand your issue.\n\nWhat did you do before the bug happened? (Steps to reproduce your issue)\n\n    Note: Was redirected from\n[here](https://github.com/git-for-windows/git/issues/5234), on the\nspeculation that the bug report might not be Windows-specific.\n\n    1. Open git-gui from the Windows start menu (or whatever the\nequivalent on Linux is)\n    2. Select an existing repo, either through `Open Existing\nRepository` or one of the paths below `Open Recent Repository`\n    3. From the top menu, click `Repository`, click `Git Bash`\n    4. In git-bash, `cd /` (expecting `/` to *not* to be a git repo),\nthen `git status`\n\nWhat did you expect to happen? (Expected behavior)\n\n    fatal: not a git repository (or any of the parent directories): .git\n\nWhat happened instead? (Actual behavior)\n\n    On branch foo\n    Your branch is up to date with 'origin/foo'.\n\n    nothing to commit, working tree clean\n\nWhat's different between what you expected and what actually happened?\n\n    The output messages. The expected behavior is to fatal. The actual\nbehavior did *not* fatal. In both cases, the current working directory\nis at the filesystem root, which is expected to not be a git repo.\n\nAnything else you want to add:\n\n    It seems that what is affecting this is that opening up git-gui\nsets the `GIT_DIR` env var automatically. The resulting behavior seems\nsomewhat non-intuitive and confused myself and a colleague. The\nresulting behavior I expected was the behavior one would get if\ngit-gui spawned a git-bash shell with the current working directory\nset to the repo's path, but *without* setting `GIT_DIR`.\n\nPlease review the rest of the bug report below.\nYou can delete any lines you don't wish to share.\n\n    [System Info]\n    git version:\n    git version 2.45.0.windows.1\n    cpu: x86_64\n    built from commit: b5d0511969ccd9ab86395c37e5a7619d8b4e7c32\n    sizeof-long: 4\n    sizeof-size_t: 8\n    shell-path: /bin/sh\n    feature: fsmonitor--daemon\n    uname: Windows 10.0 19045\n    compiler info: gnuc: 13.2\n    libc info: no libc information available\n    $SHELL (typically, interactive shell): C:\\Program Files\\Git\\usr\\bin\\bash.exe\n\n\n    [Enabled Hooks]\n    post-checkout\n    post-commit\n    post-merge\n    pre-push\n\n- Kevin Navero\n"}]}