- //fprintf(stderr, "fetch %s\n", sha1_to_hex(obj->sha1));
-
- if (make_sure_we_have_it(obj->type ? obj->type : "object",
- obj->sha1))
- return -1;
+ /* If we are not scanning this object, we placed it in
+ * the queue because we needed to fetch it first.
+ */
+ if (! (obj->flags & TO_SCAN)) {
+ if (fetch(obj->sha1)) {
+ report_missing(obj->type
+ ? obj->type
+ : "object", obj->sha1);
+ return -1;
+ }
+ }