···23import (
4 "os"
5+ "path/filepath"
6+ "strings"
78 "github.com/go-git/go-billy/v5"
9···61 continue
62 }
6364+ p := fi.Name()
65+66+ // Handles the case whereby just the volume name ("C:") is appended,
67+ // to root. Change it to "C:\", which is better handled by fs.Join().
68+ if filepath.VolumeName(p) != "" && !strings.HasSuffix(p, string(filepath.Separator)) {
69+ p = p + string(filepath.Separator)
70+ }
71+ path := append(root, p)
7273 dirAttributes, err := ReadAttributesFile(fs, path, gitattributesFile, false)
74 if err != nil {