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

references.go: fix Parents from commit iterator #319

Merged
merged 2 commits into from
Apr 20, 2017
Merged

references.go: fix Parents from commit iterator #319

merged 2 commits into from
Apr 20, 2017

Conversation

ajnavarro
Copy link
Contributor

Avoid a panic when we are iterating parents from a commit. There are more than EOF errors, like Parse errors. Now instead of throw a panic we return the error.

@ajnavarro ajnavarro requested review from alcortesm and smola March 29, 2017 10:10
@codecov
Copy link

codecov bot commented Mar 29, 2017

Codecov Report

Merging #319 into master will increase coverage by 0.66%.
The diff coverage is 57.14%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #319      +/-   ##
==========================================
+ Coverage   76.65%   77.32%   +0.66%     
==========================================
  Files         122      117       -5     
  Lines        8439     8017     -422     
==========================================
- Hits         6469     6199     -270     
+ Misses       1260     1157     -103     
+ Partials      710      661      -49
Impacted Files Coverage Δ
references.go 69.16% <57.14%> (-4.07%) ⬇️
worktree.go 56.69% <0%> (-7.84%) ⬇️
plumbing/object/tree.go 74.37% <0%> (-3.52%) ⬇️
plumbing/transport/http/common.go 69.23% <0%> (-1.14%) ⬇️
repository.go 71.78% <0%> (-0.49%) ⬇️
plumbing/revlist/revlist.go 80.3% <0%> (-0.3%) ⬇️
plumbing/object/change.go 100% <0%> (ø) ⬆️
plumbing/transport/ssh/common.go 0% <0%> (ø) ⬆️
_examples/common.go 23.07% <0%> (ø) ⬆️
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c68ac9e...bc4bbee. Read the comment docs.

@mcuadros
Copy link
Contributor

How hard is implement a test for this?

@ajnavarro
Copy link
Contributor Author

ajnavarro commented Mar 30, 2017

I'll have a look to how to test this. One approximation could be have a correct Commit object that some of his parents doesn't exists into the ObjectStorer.

@alcortesm
Copy link
Contributor

It should be pretty easy if we mock the ObjectStorer.

smola
smola previously approved these changes Apr 3, 2017
@smola
Copy link
Collaborator

smola commented Apr 3, 2017

You can use an in-memory ObjectStorer for this.

@smola smola dismissed their stale review April 3, 2017 07:55

not tested yet

ajnavarro and others added 2 commits April 19, 2017 13:04
Avoid a panic when we are iterating parents from a commit. There are more than EOF errors, like Parse errors. Now instead of throw a panic we return the error.
@ajnavarro
Copy link
Contributor Author

@smola @mcuadros @alcortesm Added tests using in-memory ObjectStorer.

@smola smola merged commit a41491f into src-d:master Apr 20, 2017
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.

4 participants