Skip to content

iofs: Open rejects valid paths on Windows due to filepath.Clean #194

@puerco

Description

@puerco

Bug Description

The iofs adapter's Open method validates paths using filepath.Clean, which is OS-specific leading to paths being rejected on windows.

For example, on Windows, filepath.Clean("signature/signature.json") would return signature\signature.json (with backslashes). Since that doesn't match the original forward-slash path, the check name != filepath.Clean(name) fails and returns ErrInvalid.

go-git Version

f70eb2c

Steps to Reproduce

I think the easiest way to repro would be (on a windows box):

  1. Remove the skip on line39 of iofs_test.go
  2. Then: go test ./helper/iofs/ -run TestWithFSTest

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions