This code is duplicated from the `get` method, with the exception of an argument to `do_download`.  Should be extracted to a method called by both `get` and `getmerge`.