wisetime-io / vscode-branch-in-window-title

Visual Studio Code extension that shows the current Git branch in the window title
Apache License 2.0
12 stars 6 forks source link

Title isn't populated when in a subfolder of a repository #21

Closed Eric162 closed 2 months ago

Eric162 commented 7 months ago

First of all - thank you for this extension - it should be a part of VS code natively!

This line makes an assumption that you're always in the root of a project. In reality for very large monorepos people (like me) probably just open subfolders).

https://github.com/wisetime-io/vscode-branch-in-window-title/blob/14957fe142f1c4ffe7e7b50758a1d18014e79dce/src/extension.ts#L16C69-L16C69

It would be awesome instead of using the workspace root, to instead get the git root using something like:

function getRepositoryRoot() {
  return resolve(execSync('git rev-parse --show-toplevel').toString().trim());
}

I believe this would also solve #16 most likely. I'll take a stab at it in a PR

AnrDaemon commented 4 months ago

Should be fixed by #23 for good.

vyshane commented 2 months ago

We have released v0.2.0 which addresses this. Thank you for your contribution @AnrDaemon.