gitutil: sanitize root dir on WSL

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax
2023-12-15 15:33:10 +01:00
parent 8484fcdd57
commit ac5b3241b1
5 changed files with 57 additions and 1 deletions

View File

@ -66,7 +66,11 @@ func (c *Git) IsDirty() bool {
}
func (c *Git) RootDir() (string, error) {
return c.clean(c.run("rev-parse", "--show-toplevel"))
root, err := c.clean(c.run("rev-parse", "--show-toplevel"))
if err != nil {
return "", err
}
return sanitizePath(root), nil
}
func (c *Git) GitDir() (string, error) {