sync: Fix exception in an exsiting clone (without partial-clone).

Default the partial_clone_exclude argument to an empty set.

Fixes the following report by Emil Medve.

With this change (up to v2.14.1), on an existing "normal" clone (without partial-clone options) I'm seeing this traceback during `repo selfupdate`:

Traceback (most recent call last):

  File ".../.repo/repo/", line 630, in <module>
  File ".../.repo/repo/", line 604, in _Main
    result = run()
  File ".../.repo/repo/", line 597, in <lambda>
    run = lambda: repo._Run(name, gopts, argv) or 0
  File ".../.repo/repo/", line 261, in _Run
    result = cmd.Execute(copts, cargs)
  File ".../.repo/repo/subcmds/", line 54, in Execute
    if not rp.Sync_NetworkHalf():
  File ".../.repo/repo/", line 1091, in Sync_NetworkHalf
    if in partial_clone_exclude:
TypeError: argument of type 'NoneType' is not iterable

$ ./run_tests -v

Change-Id: I71e744e4ef2a37b13aa9ba42eba3935e78c4e40a
Reviewed-by: Mike Frysinger <>
Tested-by: Raman Tenneti <>
diff --git a/ b/
index 1e31a20..6679ee3 100644
--- a/
+++ b/
@@ -1051,7 +1051,7 @@
-                       partial_clone_exclude=None):
+                       partial_clone_exclude=set()):
     """Perform only the network IO portion of the sync process.
        Local working directory/branch state is not affected.