diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
index 47e3f554df35245c95cbb87a30cc8ba557259427_bWVyY3VyaWFsL2xvY2FscmVwby5weQ==..64cdfcc73706bf75d8304917ed0666f313221ab6_bWVyY3VyaWFsL2xvY2FscmVwby5weQ== 100644
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -3010,6 +3010,8 @@
         wdirvfs.makedirs()
 
     hgvfs.makedir(notindexed=True)
+    if 'sharedrepo' not in createopts:
+        hgvfs.mkdir(b'cache')
 
     if b'store' in requirements and 'sharedrepo' not in createopts:
         hgvfs.mkdir(b'store')
diff --git a/tests/test-empty.t b/tests/test-empty.t
index 47e3f554df35245c95cbb87a30cc8ba557259427_dGVzdHMvdGVzdC1lbXB0eS50..64cdfcc73706bf75d8304917ed0666f313221ab6_dGVzdHMvdGVzdC1lbXB0eS50 100644
--- a/tests/test-empty.t
+++ b/tests/test-empty.t
@@ -20,6 +20,7 @@
 
   $ ls .hg
   00changelog.i
+  cache
   requires
   store
 
diff --git a/tests/test-inherit-mode.t b/tests/test-inherit-mode.t
index 47e3f554df35245c95cbb87a30cc8ba557259427_dGVzdHMvdGVzdC1pbmhlcml0LW1vZGUudA==..64cdfcc73706bf75d8304917ed0666f313221ab6_dGVzdHMvdGVzdC1pbmhlcml0LW1vZGUudA== 100644
--- a/tests/test-inherit-mode.t
+++ b/tests/test-inherit-mode.t
@@ -42,7 +42,7 @@
   $ hg init repo
   $ cd repo
 
-  $ chmod 0770 .hg/store
+  $ chmod 0770 .hg/store .hg/cache
 
 before commit
 store can be written by the group, other files cannot
@@ -51,6 +51,7 @@
   $ "$PYTHON" ../printmodes.py .
   00700 ./.hg/
   00600 ./.hg/00changelog.i
+  00770 ./.hg/cache/
   00600 ./.hg/requires
   00770 ./.hg/store/
 
@@ -116,6 +117,7 @@
   $ "$PYTHON" ../printmodes.py ../push
   00770 ../push/.hg/
   00660 ../push/.hg/00changelog.i
+  00770 ../push/.hg/cache/
   00660 ../push/.hg/requires
   00770 ../push/.hg/store/