diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py
index df5d3734b3dfb8bfc7e1d11c5e39f53c5345da8f_bWVyY3VyaWFsL3RlbXBsYXRla3cucHk=..cf1e15f91c90ec894c283caf6e7b562ccdc73c98_bWVyY3VyaWFsL3RlbXBsYXRla3cucHk= 100644
--- a/mercurial/templatekw.py
+++ b/mercurial/templatekw.py
@@ -299,7 +299,7 @@
     """String. Statistics of changes with the following format:
     "modified files: +added/-removed lines"
     """
-    stats = patch.diffstatdata(util.iterlines(ctx.diff()))
+    stats = patch.diffstatdata(util.iterlines(ctx.diff(noprefix=False)))
     maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats)
     return '%s: +%s/-%s' % (len(stats), adds, removes)
 
diff --git a/tests/test-import.t b/tests/test-import.t
index df5d3734b3dfb8bfc7e1d11c5e39f53c5345da8f_dGVzdHMvdGVzdC1pbXBvcnQudA==..cf1e15f91c90ec894c283caf6e7b562ccdc73c98_dGVzdHMvdGVzdC1pbXBvcnQudA== 100644
--- a/tests/test-import.t
+++ b/tests/test-import.t
@@ -1517,6 +1517,13 @@
   |
   o  initial [Babar] 2: +8/-0
   
+Adding those config options should not change the output of diffstat. Bugfix #4755.
+
+  $ hg log -r . --template '{diffstat}\n'
+  1: +1/-0
+  $ hg log -r . --template '{diffstat}\n' --config diff.git=1 \
+  >   --config diff.noprefix=1
+  1: +1/-0
 
 Importing with some success and some errors: