diff --git a/mercurial/vfs.py b/mercurial/vfs.py
index f51750744701e52b6a7ba5c0e173e36ebaded1a3_bWVyY3VyaWFsL3Zmcy5weQ==..53d0f7da34fb43433d48aab062d34ffc01fb1389_bWVyY3VyaWFsL3Zmcy5weQ== 100644
--- a/mercurial/vfs.py
+++ b/mercurial/vfs.py
@@ -477,7 +477,7 @@
             <mode> is the file mode that need to be set if any.
         """
         real_path = self.join(path)
-        self._auditpath(real_path, b'wb')
+        self._auditpath(path, b'wb')
         self.register_file(path)
         dirname, basename = util.split(real_path)
         if dirname not in known_directories:
diff --git a/tests/test-stream-bundle-v2.t b/tests/test-stream-bundle-v2.t
index f51750744701e52b6a7ba5c0e173e36ebaded1a3_dGVzdHMvdGVzdC1zdHJlYW0tYnVuZGxlLXYyLnQ=..53d0f7da34fb43433d48aab062d34ffc01fb1389_dGVzdHMvdGVzdC1zdHJlYW0tYnVuZGxlLXYyLnQ= 100644
--- a/tests/test-stream-bundle-v2.t
+++ b/tests/test-stream-bundle-v2.t
@@ -36,6 +36,8 @@
   $ cp $HGRCPATH $TESTTMP/hgrc.orig
 
   $ cat >> $HGRCPATH << EOF
+  > [ui]
+  > portablefilenames=abort
   > [experimental]
   > evolution.createmarkers=True
   > evolution.exchange=True