jelmer/dulwich — pull request #69 by D-Key (2012-08-02 21:42:43+00:00)
Title: repo.clone() fix for a missing 'HEAD' ref.

One of my work repos didn't have a HEAD (and used a different name for master branch).

Dulwich clone() raised an exception when failed to set target repo head, though at that point, the target repo was fully cloned, and update to the HEAD ref was not necessary.

It might be useful to either add a conditional check for source head_sha availability and skip this step if there is no head to update or, if that's not desirable for some reason, add a specific exception that cloning headless repos is not supported.