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

git: return better error message when packfile cannot be downloaded #1031

Merged
merged 2 commits into from
Dec 4, 2018

Conversation

jfontan
Copy link
Contributor

@jfontan jfontan commented Nov 30, 2018

Previously the error message when the connection was closed while fetching was "object not found" and was misleading. Now when the packfile size is 0 the error "unable to fetch packfile" is returned.

Does not come with test as I haven't found a way to correctly break the connection while the packfile is being downloaded. Starting git daemon and killing it after some time is not deterministic enough and can be flaky.

Related to src-d/borges#314

Previously the error message when the connection was closed while
fetching was "object not found" and was misleading. Now when the
packfile size is 0 the error "unable to fetch packfile" is returned.

Signed-off-by: Javi Fontan <jfontan@gmail.com>
@jfontan jfontan requested review from smola, mcuadros and a team November 30, 2018 15:05
@mcuadros
Copy link
Contributor

mcuadros commented Dec 1, 2018

You can test it, giving to it an empty io.Reader, no?

Signed-off-by: Javi Fontan <jfontan@gmail.com>
@jfontan
Copy link
Contributor Author

jfontan commented Dec 3, 2018

I've added a small test that check for ErrEmptyPackfile error with an empty packfile. Still it does not test that a broken connection returns that error.

@smola
Copy link
Collaborator

smola commented Dec 4, 2018

Keep in mind that this needs to trigger a minor, not patch version (new error returned from existing function).

@mcuadros mcuadros merged commit 443abf8 into src-d:master Dec 4, 2018
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.

None yet

6 participants