Skip to content

Cherry pick of go-git/go-billy#195 into v5#197

Merged
pjbgf merged 3 commits into
go-git:releases/v5.xfrom
puerco:winpaths
Apr 7, 2026
Merged

Cherry pick of go-git/go-billy#195 into v5#197
pjbgf merged 3 commits into
go-git:releases/v5.xfrom
puerco:winpaths

Conversation

@puerco

@puerco puerco commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

This is a cherry pick of #195 into the v5 release branch.

I believe this to be a candidate as per the contribution guidelines, this backport is fixes a critical bug breaking the iofs adatper on windows.

puerco and others added 3 commits April 7, 2026 16:20
This commit uses fs.ValidPath to verify the paths passed to Open()
instead of trying to implement the same checks in the Open() method.

Signed-off-by: Adolfo García Veytia (Puerco) <adolfo.garcia@uservers.net>
Signed-off-by: Adolfo García Veytia (Puerco) <adolfo.garcia@uservers.net>
Signed-off-by: Adolfo García Veytia (Puerco) <puerco@carabiner.dev>
Copilot AI review requested due to automatic review settings April 7, 2026 22:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Backports #195 to the v5 branch to fix Windows path validation in the iofs adapter so io/fs-style forward-slash paths are accepted correctly.

Changes:

  • Replace filepath.Clean-based validation in adapterFs.Open with fs.ValidPath + explicit backslash rejection.
  • Apply the same path validation to ReadDir, Stat, and ReadFile.
  • Update/add tests to run fstest.TestFS on Windows and add a forward-slash regression test.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
helper/iofs/iofs.go Switches path validation to fs.ValidPath + backslash rejection and extends it across adapter methods.
helper/iofs/iofs_test.go Removes Windows skip, normalizes test paths to forward slashes, and adds a regression test for forward-slash paths.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread helper/iofs/iofs_test.go

@pjbgf pjbgf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@puerco thanks for working on this. 🙇

@pjbgf pjbgf merged commit 416e0a5 into go-git:releases/v5.x Apr 7, 2026
14 of 15 checks passed
Maks1mS pushed a commit to stplr-dev/stplr that referenced this pull request May 10, 2026
This PR contains the following updates:

| Package | Type | Update | Change | OpenSSF |
|---|---|---|---|---|
| [github.com/go-git/go-billy/v5](https://github.com/go-git/go-billy) | require | minor | `v5.8.0` → `v5.9.0` | [![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/go-git/go-billy/badge)](https://securityscorecards.dev/viewer/?uri=github.com/go-git/go-billy) |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/23) for more information.

---

### Release Notes

<details>
<summary>go-git/go-billy (github.com/go-git/go-billy/v5)</summary>

### [`v5.9.0`](https://github.com/go-git/go-billy/releases/tag/v5.9.0)

[Compare Source](go-git/go-billy@v5.8.0...v5.9.0)

#### What's Changed

- Use path.Clean instead of filepath.Clean in iofs.Open by [@&#8203;puerco](https://github.com/puerco) in [#&#8203;197](go-git/go-billy#197)
- Deprecate ChrootOS in favour of BoundOS by [@&#8203;pjbgf](https://github.com/pjbgf) in [#&#8203;201](go-git/go-billy#201)
- General Improvements by [@&#8203;pjbgf](https://github.com/pjbgf) in [#&#8203;203](go-git/go-billy#203)
- osfs: ChrootOS eval baseDir on creation by [@&#8203;pjbgf](https://github.com/pjbgf) in [#&#8203;205](go-git/go-billy#205)
- Run go-git tests as part of integration tests by [@&#8203;pjbgf](https://github.com/pjbgf) in [#&#8203;206](go-git/go-billy#206)

**Full Changelog**: <go-git/go-billy@v5.8.0...v5.9.0>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At 12:00 AM through 04:59 AM and 10:00 PM through 11:59 PM, Monday through Friday (`* 0-4,22-23 * * 1-5`)
  - Only on Sunday and Saturday (`* * * * 0,6`)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xMzIuMyIsInVwZGF0ZWRJblZlciI6IjQzLjEzMi4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJLaW5kL0RlcGVuZGVuY2llcyJdfQ==-->

Reviewed-on: https://altlinux.space/stapler/stplr/pulls/426
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants