summaryrefslogtreecommitdiff
path: root/local-fetch.c
diff options
context:
space:
mode:
authorNick Hengeveld <nickh@reactrix.com>2005-10-11 06:22:01 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-10-11 06:22:01 (GMT)
commit11f0dafe2be419240c0006c3e9112cbad3568baf (patch)
tree57108f4d25274418051dc75df946120a270c4d0a /local-fetch.c
parent380792390e05e744f9d7eefbc35d1db80e44e27a (diff)
downloadgit-11f0dafe2be419240c0006c3e9112cbad3568baf.zip
git-11f0dafe2be419240c0006c3e9112cbad3568baf.tar.gz
git-11f0dafe2be419240c0006c3e9112cbad3568baf.tar.bz2
[PATCH] Don't fetch objects that exist in the local repository
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>
Diffstat (limited to 'local-fetch.c')
-rw-r--r--local-fetch.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/local-fetch.c b/local-fetch.c
index a57386c..87a93de 100644
--- a/local-fetch.c
+++ b/local-fetch.c
@@ -166,7 +166,10 @@ static int fetch_file(const unsigned char *sha1)
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)