jelmer/dulwich — pull request #84 by Reidsy (2013-02-11 04:14:04+00:00)
Title: HttpClient crash when cloning a repository that returns 404

This patch fixes a bug in `HttpClient` and `GitClient` which occurs when cloning a repo that returns a 404 (or any other http error).

When cloning a repository served over http that returns an error code, `urllib2.HTTPError` would be raised. The exception is not caught until `GitClient.fetch()` where it will attempt to commit without any data. The commit will fail and throw a TypeError crashing dulwich.

I have removed the 'try ... finally' block inside GitClient.fetch() so when exceptions such as NotGitRepository() or GitProtocolError() are raised they are not caught.