gitfs
gitfs copied to clipboard
error when using go run github.com/posener/gitfs/cmd/gitfs ./...
this is the error
Failed encoding filesystem "github.com/segator/transcoderd": opening file .git\COMMIT_EDITMSG: http: invalid character in file path
in my main.go i have this
err := gitfs.New(ctx,
"github.com/segator/transcoderd",)
the working dir where main.go exists is a git repo poiting to github.com/segator/transcoderd
any idea?
Hey, are you using a windows machine by any chance?
Yes I am
I see. The Windows' forward slash looks to cause the error. I guess here: https://github.com/posener/gitfs/blob/23d43300579d7c7b147ca7cc93adad6c94ec8291/internal/binfs/binfs.go#L142
I think that the error is here: https://github.com/posener/gitfs/blob/23d43300579d7c7b147ca7cc93adad6c94ec8291/internal/localfs/localfs.go#L28
When reading from a Windows filesystem, the path parts are joined with a forward slash, but since we are building an "http" filesystem, we should join them with backward slash.