Browse Source

Only fetch objects we don't already have.

Jelmer Vernooij 4 years ago
parent
commit
33e8998f8c
1 changed files with 3 additions and 1 deletions
  1. 3 1
      dulwich/porcelain.py

+ 3 - 1
dulwich/porcelain.py

@@ -984,7 +984,9 @@ def pull(repo, remote_location=None, refspecs=None,
         def determine_wants(remote_refs):
             selected_refs.extend(
                 parse_reftuples(remote_refs, r.refs, refspecs))
-            return [remote_refs[lh] for (lh, rh, force) in selected_refs]
+            return [
+                remote_refs[lh] for (lh, rh, force) in selected_refs
+                if remote_refs[lh] not in r.object_store]
         client, path = get_transport_and_path(
                 remote_location, config=r.get_config_stack(), **kwargs)
         fetch_result = client.fetch(