Do not try to fetch default revision for mirrors always

* Mirrors may contain multiple projects, some of which may not
  always contain the default revision.
* Only fetch the default revision explicitly if
  '--current-branch' is set.
* Fixes breakage casued by
  commit 6856f98467aa5c98085cdee02587dbab984cebb1
  "Fix repo mirror with --current-branch"

Change-Id: Iaafabe2992f76f3644b841f24245d3e19c9515a9
Reviewed-by: Kuang-che Wu <>
Reviewed-by: Mike Frysinger <>
Tested-by: Chirayu Desai <>
(cherry picked from commit f7b64e3350a622ee87e1927cdbc8d854a5696d85)
diff --git a/ b/
index d12d466..281ba4b 100755
--- a/
+++ b/
@@ -2252,7 +2252,10 @@
-    branch = self.revisionExpr
+    if self.manifest.IsMirror and not current_branch_only:
+      branch = None
+    else:
+      branch = self.revisionExpr
     if (not self.manifest.IsMirror and is_sha1 and depth
         and git_require((1, 8, 3))):
       # Shallow checkout of a specific commit, fetch from that commit and not