Skip to content

[BUG] Extension does not handle git worktrees correctly #65

Description

@RasmusRendal

Describe the bug
When getting the .git/config, it assumes that it's in the work directory:

constgitConfig=Uri.file(`${pathToWorkspace}/.git/config`);

If somebody like me is a fan of worktrees, they won't have a .git folder in their workspace. Instead, .git will be a text file containing something like this:

gitdir: /home/rasmus/Projects/repo/main/.git/worktrees/branch

When running the codecov extension in a linked worktree, that has such a .git file in lieu of a directory, that will result in the following error:

 Error: ENOTDIR: not a directory, open '/home/rasmus/Projects/repo/branch/.git/config'

To Reproduce
Steps to reproduce the behavior:

  1. Clone a repository
  2. Run git worktree add -B branch ../branch
  3. Open ../branch in vscode with the codecov extension enabled

Expected behavior
The codecov extension should correctly resolve the git repository, and work as well in linked worktrees as in main worktrees.

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions