Skip to content

Buffer read change in Go 1.7 breaks readObjectFile() #18

@snicol

Description

@snicol

I found that after upgrading to Go 1.7, repo.GetCommitOfBranch(branch) started returning an EOF and not the commit sha1 that I expected.

https://github.com/gogits/git/blob/564c5fe86bbef8589421582b69657cc08c4c85fb/repo_utils.go#L306

I dug in and found that simply removing the error check fixes this, which matches up with the release notes below.

In previous releases of Go, if Reader's Read method were asked for zero bytes with no data remaining, it would return a count of 0 and no error. Now it returns a count of 0 and the error io.EOF

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions