summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3807923)
raw | patch | inline | side by side (parent: 3807923)
author | Nick Hengeveld <nickh@reactrix.com> | |
Tue, 11 Oct 2005 06:22:01 +0000 (23:22 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Tue, 11 Oct 2005 06:22:01 +0000 (23:22 -0700) |
Be sure not to fetch objects that already exist in the local repository.
The main process loop no longer performs this check, http-fetch now checks
prior to starting a new request queue entry and when fetch_object() is called,
and local-fetch now checks when fetch_object() is called.
As discussed in this thread: http://marc.theaimsgroup.com/?t=112854890500001
Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
The main process loop no longer performs this check, http-fetch now checks
prior to starting a new request queue entry and when fetch_object() is called,
and local-fetch now checks when fetch_object() is called.
As discussed in this thread: http://marc.theaimsgroup.com/?t=112854890500001
Signed-off-by: Nick Hengeveld <nickh@reactrix.com>
fetch.c | patch | blob | history | |
http-fetch.c | patch | blob | history | |
local-fetch.c | patch | blob | history |
index 3e073d3584c25e35da0163689508599659328605..73bde07aeaeea67e44aef7aec1b79d5806e80a1b 100644 (file)
--- a/fetch.c
+++ b/fetch.c
* the queue because we needed to fetch it first.
*/
if (! (obj->flags & TO_SCAN)) {
- if (!has_sha1_file(obj->sha1) && fetch(obj->sha1)) {
+ if (fetch(obj->sha1)) {
report_missing(obj->type
? obj->type
: "object", obj->sha1);
diff --git a/http-fetch.c b/http-fetch.c
index dd9ea4ca17d83f3267c4d9d7fe04b5e49a19cff2..d1e4593ba79d17b824e54c4f2b68324de5cf365e 100644 (file)
--- a/http-fetch.c
+++ b/http-fetch.c
while (active_requests < max_requests && request != NULL) {
if (request->state == WAITING) {
- start_request(request);
+ if (has_sha1_file(request->sha1))
+ release_request(request);
+ else
+ start_request(request);
curl_multi_perform(curlm, &num_transfers);
}
request = request->next;
if (request == NULL)
return error("Couldn't find request for %s in the queue", hex);
+ if (has_sha1_file(request->sha1)) {
+ release_request(request);
+ return 0;
+ }
+
#ifdef USE_CURL_MULTI
int num_transfers;
while (request->state == WAITING) {
diff --git a/local-fetch.c b/local-fetch.c
index a57386ca6a632c2e0a43348ed8b147692746a44f..87a93de02f759f544ebfd1d6fb584886f483fbfc 100644 (file)
--- a/local-fetch.c
+++ b/local-fetch.c
int fetch(unsigned char *sha1)
{
- return fetch_file(sha1) && fetch_pack(sha1);
+ if (has_sha1_file(sha1))
+ return 0;
+ else
+ return fetch_file(sha1) && fetch_pack(sha1);
}
int fetch_ref(char *ref, unsigned char *sha1)