Skip to content

Abbreviate Git Directory Edge Cases #746

@dahlbyk

Description

@dahlbyk

Two edge cases not considered by original implementation (#720):

  1. If the current repo is bare, returns its parent directory.
  2. Get-GitDirectory inside a worktree currently returns the path to .git/worktrees/[name], which won't match the current path. I can think of two ways to resolve this:
    1. Revise Get-GitDirectory to return the contents of .git/worktrees/[name]/gitdir. No idea what the downstream effects of this would be.
    2. Check here if $gitPath matches .git/worktrees/; if it does, set $gitPath to the contents of $gitPath/gitdir

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions