Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Use CheckClose with named returns and fix tests #794

Merged
merged 3 commits into from
Apr 2, 2018

Conversation

jfontan
Copy link
Contributor

@jfontan jfontan commented Mar 27, 2018

Previously some close errors were losts. This is especially problematic in go-git as lots of work is done here like generating indexes and moving packfiles.

Some tests write to an already existing repository retrieved from fixtures. The permissions of these files are read only and make receive pack fail. This was shadowed before as close errors were lost.

Fixes: #791

jfontan added 2 commits March 27, 2018 17:32
Previously some close errors were losts. This is specially problematic
in go-git as lots of work is done here like generating indexes and
moving packfiles.

Signed-off-by: Javi Fontan <[email protected]>
Some tests write to an already existent repository retrieved from
fixtures. The permissions of these files are read only and make
receive pack fail. This was shadowed before as close errors were
lost.

Signed-off-by: Javi Fontan <[email protected]>
@jfontan jfontan requested review from smola and mcuadros March 27, 2018 15:59
@@ -375,7 +375,7 @@ func (d *DotGit) findPackedRefsInFile(f billy.File) ([]*plumbing.Reference, erro
return refs, s.Err()
}

func (d *DotGit) findPackedRefs() ([]*plumbing.Reference, error) {
func (d *DotGit) findPackedRefs() (r []*plumbing.Reference, error error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this one is called error instead of err, and you are using err on the code. Is a leftover or am I missing something?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's my sloppy fingers, thanks! Just fixed it.

@mcuadros mcuadros merged commit 0c2618b into src-d:master Apr 2, 2018
jfontan added a commit to jfontan/old-go-git that referenced this pull request Jun 6, 2018
The cache is used in Tree.FindEntry for faster path search.

Signed-off-by: Javi Fontan <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CheckClose should be used with named returns
3 participants