diff --git a/mercurial/revlog.py b/mercurial/revlog.py
index 704c3d0878d93fc4e8fe0b72b2b1c9f0f3fe91a9_bWVyY3VyaWFsL3JldmxvZy5weQ==..74c004a515bce78d205c9741a4e8ada6e55ef418_bWVyY3VyaWFsL3JldmxvZy5weQ== 100644
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -292,6 +292,9 @@
 
     @staticmethod
     def is_inline_index(header_bytes):
+        if len(header_bytes) == 0:
+            return True
+
         header = INDEX_HEADER.unpack(header_bytes)[0]
 
         _format_flags = header & ~0xFFFF
diff --git a/tests/test-clone-stream.t b/tests/test-clone-stream.t
index 704c3d0878d93fc4e8fe0b72b2b1c9f0f3fe91a9_dGVzdHMvdGVzdC1jbG9uZS1zdHJlYW0udA==..74c004a515bce78d205c9741a4e8ada6e55ef418_dGVzdHMvdGVzdC1jbG9uZS1zdHJlYW0udA== 100644
--- a/tests/test-clone-stream.t
+++ b/tests/test-clone-stream.t
@@ -980,3 +980,15 @@
   $ mkdir -p empty-repo/.hg
   $ hg clone -q --stream ssh://user@dummy/empty-repo empty-repo2
   $ hg --cwd empty-repo2 verify -q
+
+Cloning a repo with an empty manifestlog doesn't give some weird error
+
+  $ rm -r empty-repo; hg init empty-repo
+  $ (cd empty-repo; touch x; hg commit -Am empty; hg debugstrip -r 0) > /dev/null
+  $ hg clone -q --stream ssh://user@dummy/empty-repo empty-repo3
+  $ hg --cwd empty-repo3 verify -q 2>&1 | grep -v warning
+  [1]
+
+The warnings filtered out here are talking about zero-length 'orphan' data files.
+Those are harmless, so that's fine.
+