Skip to content

vendor: go-git: import IsDir() check for readReferenceFile() #11208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

kevans91
Copy link
Contributor

This fix has been accepted and merged upstream; the gist of the problem is
that readReferenceFile() must check that what it's been requested to read
isn't a directory. read() on a directory fd may work on some platforms (e.g.
FreeBSD), so readReferenceFile() would previously succeed at the earliest
point in a branch name (e.g. "feature" in "feature/myfeature") despite the
fact that this isn't a branch ref but a directory.

Fixes issue #9938

Signed-off-by: Kyle Evans [email protected]

PR notes:

  • I've made this against release/v1.11 because that's where we observed the bug, but it's also applicable to master and I've verified that it cleanly cherry picks forward as well. Your contributing guidelines lead me to believe that I should target the branch it was observed on, apologies if this is incorrect and I'll create the PR against master instead.
  • Corresponds to go-git/go-git@63967ab sans amendment to the tests introduced in the commit just prior to that one.

This fix has been accepted and merged upstream; the gist of the problem is
that readReferenceFile() must check that what it's been requested to read
isn't a directory. read() on a directory fd may work on some platforms (e.g.
FreeBSD), so readReferenceFile() would previously succeed at the earliest
point in a branch name (e.g. "feature" in "feature/myfeature") despite the
fact that this isn't a branch ref but a directory.

Fixes issue go-gitea#9938

Signed-off-by: Kyle Evans <[email protected]>
@lafriks
Copy link
Member

lafriks commented Apr 24, 2020

vendored files should be updated using go get -u github.com/go-git/go-git/v5 and first targeted to master branch

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 24, 2020
@kevans91
Copy link
Contributor Author

vendored files should be updated using go get -u github.com/go-git/go-git/v5 and first targeted to master branch

So we must wait for this commit to show up in an upstream release before it can be pulled into gitea? go get -u github.com/go-git/go-git/v5 doesn't bring it in at the moment, but I'm wholly unfamiliar with golang beyond the little bit of time I've spent on triage here.

re: branch, acknowledged, thanks!

@lafriks
Copy link
Member

lafriks commented Apr 24, 2020

Yeah, we need to wait for go-git release

@kevans91
Copy link
Contributor Author

Alright, thanks! We'll carry the patch locally until it can make its way here.

@kevans91 kevans91 closed this Apr 24, 2020
@kevans91 kevans91 mentioned this pull request Apr 25, 2020
7 tasks
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
@delvh delvh added issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea and removed reviewed/invalid labels Oct 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/not-a-bug The reported issue is the intended behavior or the problem is not inside Gitea lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants