diff --git a/tests/test-conflict-1.t b/tests/test-conflict-1.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC1jb25mbGljdC0xLnQ=..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC1jb25mbGljdC0xLnQ= 100755
--- a/tests/test-conflict-1.t
+++ b/tests/test-conflict-1.t
@@ -54,9 +54,8 @@
 
   $ mkdir gitrepo
   $ cd gitrepo
-  $ git init --bare | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo/
-  
+  $ git init --bare
+  Initialized empty Git repository in $TESTTMP/gitrepo/
 
 dulwich does not presently support local git repos, workaround
   $ cd ..
diff --git a/tests/test-conflict-2.t b/tests/test-conflict-2.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC1jb25mbGljdC0yLnQ=..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC1jb25mbGljdC0yLnQ= 100755
--- a/tests/test-conflict-2.t
+++ b/tests/test-conflict-2.t
@@ -54,9 +54,8 @@
 
   $ mkdir gitrepo
   $ cd gitrepo
-  $ git init --bare | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo/
-  
+  $ git init --bare
+  Initialized empty Git repository in $TESTTMP/gitrepo/
 
 dulwich does not presently support local git repos, workaround
   $ cd ..
diff --git a/tests/test-convergedmerge.t b/tests/test-convergedmerge.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC1jb252ZXJnZWRtZXJnZS50..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC1jb252ZXJnZWRtZXJnZS50 100755
--- a/tests/test-convergedmerge.t
+++ b/tests/test-convergedmerge.t
@@ -55,9 +55,8 @@
 
   $ mkdir gitrepo
   $ cd gitrepo
-  $ git init --bare | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo/
-  
+  $ git init --bare
+  Initialized empty Git repository in $TESTTMP/gitrepo/
 
 dulwich does not presently support local git repos, workaround
   $ cd ..
diff --git a/tests/test-empty-working-tree.t b/tests/test-empty-working-tree.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC1lbXB0eS13b3JraW5nLXRyZWUudA==..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC1lbXB0eS13b3JraW5nLXRyZWUudA== 100755
--- a/tests/test-empty-working-tree.t
+++ b/tests/test-empty-working-tree.t
@@ -19,12 +19,11 @@
 
   $ mkdir gitrepo
   $ cd gitrepo
-  $ git init | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo/.git/
-  
+  $ git init
+  Initialized empty Git repository in $TESTTMP/gitrepo/.git/
 
   $ git commit --allow-empty -m empty >/dev/null 2>/dev/null || echo "git commit error"
 
   $ cd ..
   $ mkdir gitrepo2
   $ cd gitrepo2
@@ -25,12 +24,11 @@
 
   $ git commit --allow-empty -m empty >/dev/null 2>/dev/null || echo "git commit error"
 
   $ cd ..
   $ mkdir gitrepo2
   $ cd gitrepo2
-  $ git init --bare | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo2/
-  
+  $ git init --bare
+  Initialized empty Git repository in $TESTTMP/gitrepo2/
 
 dulwich does not presently support local git repos, workaround
   $ cd ..
diff --git a/tests/test-encoding.t b/tests/test-encoding.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC1lbmNvZGluZy50..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC1lbmNvZGluZy50 100755
--- a/tests/test-encoding.t
+++ b/tests/test-encoding.t
@@ -31,9 +31,8 @@
 
   $ mkdir gitrepo
   $ cd gitrepo
-  $ git init | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo/.git/
-  
+  $ git init
+  Initialized empty Git repository in $TESTTMP/gitrepo/.git/
 
 utf-8 encoded commit message
   $ echo alpha > alpha
@@ -51,9 +50,8 @@
   $ cd ..
   $ mkdir gitrepo2
   $ cd gitrepo2
-  $ git init --bare | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo2/
-  
+  $ git init --bare
+  Initialized empty Git repository in $TESTTMP/gitrepo2/
 
 dulwich does not presently support local git repos, workaround
   $ cd ..
diff --git a/tests/test-file-removal.t b/tests/test-file-removal.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC1maWxlLXJlbW92YWwudA==..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC1maWxlLXJlbW92YWwudA== 100755
--- a/tests/test-file-removal.t
+++ b/tests/test-file-removal.t
@@ -29,9 +29,8 @@
 
   $ mkdir gitrepo
   $ cd gitrepo
-  $ git init | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo/.git/
-  
+  $ git init
+  Initialized empty Git repository in $TESTTMP/gitrepo/.git/
   $ echo alpha > alpha
   $ git add alpha
   $ commit -m 'add alpha'
@@ -56,9 +55,8 @@
   $ cd ..
   $ mkdir gitrepo2
   $ cd gitrepo2
-  $ git init --bare | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo2/
-  
+  $ git init --bare
+  Initialized empty Git repository in $TESTTMP/gitrepo2/
 
 dulwich does not presently support local git repos, workaround
   $ cd ..
diff --git a/tests/test-git-clone.t b/tests/test-git-clone.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC1naXQtY2xvbmUudA==..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC1naXQtY2xvbmUudA== 100755
--- a/tests/test-git-clone.t
+++ b/tests/test-git-clone.t
@@ -29,9 +29,8 @@
 
   $ mkdir gitrepo
   $ cd gitrepo
-  $ git init | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo/.git/
-  
+  $ git init
+  Initialized empty Git repository in $TESTTMP/gitrepo/.git/
   $ echo alpha > alpha
   $ git add alpha
   $ commit -m 'add alpha'
diff --git a/tests/test-git-submodules.t b/tests/test-git-submodules.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC1naXQtc3VibW9kdWxlcy50..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC1naXQtc3VibW9kdWxlcy50 100644
--- a/tests/test-git-submodules.t
+++ b/tests/test-git-submodules.t
@@ -29,9 +29,8 @@
 
   $ mkdir gitrepo1
   $ cd gitrepo1
-  $ git init | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo1/.git/
-  
+  $ git init
+  Initialized empty Git repository in $TESTTMP/gitrepo1/.git/
   $ echo alpha > alpha
   $ git add alpha
   $ commit -m 'add alpha'
@@ -39,9 +38,8 @@
 
   $ mkdir gitsubrepo
   $ cd gitsubrepo
-  $ git init | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitsubrepo/.git/
-  
+  $ git init
+  Initialized empty Git repository in $TESTTMP/gitsubrepo/.git/
   $ echo beta > beta
   $ git add beta
   $ commit -m 'add beta'
diff --git a/tests/test-git-tags.t b/tests/test-git-tags.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC1naXQtdGFncy50..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC1naXQtdGFncy50 100755
--- a/tests/test-git-tags.t
+++ b/tests/test-git-tags.t
@@ -36,9 +36,8 @@
 
   $ mkdir gitrepo
   $ cd gitrepo
-  $ git init | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo/.git/
-  
+  $ git init
+  Initialized empty Git repository in $TESTTMP/gitrepo/.git/
   $ git config receive.denyCurrentBranch ignore
   $ echo alpha > alpha
   $ git add alpha
diff --git a/tests/test-hg-author.t b/tests/test-hg-author.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC1oZy1hdXRob3IudA==..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC1oZy1hdXRob3IudA== 100755
--- a/tests/test-hg-author.t
+++ b/tests/test-hg-author.t
@@ -35,9 +35,8 @@
 
   $ mkdir gitrepo
   $ cd gitrepo
-  $ git init | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo/.git/
-  
+  $ git init
+  Initialized empty Git repository in $TESTTMP/gitrepo/.git/
 
   $ echo alpha > alpha
   $ git add alpha
diff --git a/tests/test-hg-branch.t b/tests/test-hg-branch.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC1oZy1icmFuY2gudA==..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC1oZy1icmFuY2gudA== 100755
--- a/tests/test-hg-branch.t
+++ b/tests/test-hg-branch.t
@@ -39,9 +39,8 @@
 
   $ mkdir gitrepo
   $ cd gitrepo
-  $ git init | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo/.git/
-  
+  $ git init
+  Initialized empty Git repository in $TESTTMP/gitrepo/.git/
 
   $ echo alpha > alpha
   $ git add alpha
diff --git a/tests/test-hg-tags.t b/tests/test-hg-tags.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC1oZy10YWdzLnQ=..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC1oZy10YWdzLnQ= 100755
--- a/tests/test-hg-tags.t
+++ b/tests/test-hg-tags.t
@@ -35,9 +35,8 @@
 
   $ mkdir gitrepo
   $ cd gitrepo
-  $ git init | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo/.git/
-  
+  $ git init
+  Initialized empty Git repository in $TESTTMP/gitrepo/.git/
 
   $ echo alpha > alpha
   $ git add alpha
diff --git a/tests/test-incoming.t b/tests/test-incoming.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC1pbmNvbWluZy50..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC1pbmNvbWluZy50 100755
--- a/tests/test-incoming.t
+++ b/tests/test-incoming.t
@@ -39,9 +39,8 @@
 
   $ mkdir gitrepo
   $ cd gitrepo
-  $ git init | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo/.git/
-  
+  $ git init
+  Initialized empty Git repository in $TESTTMP/gitrepo/.git/
 
   $ echo alpha > alpha
   $ git add alpha
diff --git a/tests/test-keywords.t b/tests/test-keywords.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC1rZXl3b3Jkcy50..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC1rZXl3b3Jkcy50 100755
--- a/tests/test-keywords.t
+++ b/tests/test-keywords.t
@@ -28,9 +28,8 @@
 
   $ mkdir gitrepo
   $ cd gitrepo
-  $ git init | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo/.git/
-  
+  $ git init
+  Initialized empty Git repository in $TESTTMP/gitrepo/.git/
   $ echo alpha > alpha
   $ git add alpha
   $ commit -m 'add alpha'
diff --git a/tests/test-merge.t b/tests/test-merge.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC1tZXJnZS50..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC1tZXJnZS50 100755
--- a/tests/test-merge.t
+++ b/tests/test-merge.t
@@ -29,9 +29,8 @@
 
   $ mkdir gitrepo
   $ cd gitrepo
-  $ git init | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo/.git/
-  
+  $ git init
+  Initialized empty Git repository in $TESTTMP/gitrepo/.git/
   $ echo alpha > alpha
   $ git add alpha
   $ commit -m 'add alpha'
@@ -58,9 +57,8 @@
   $ cd ..
   $ mkdir gitrepo2
   $ cd gitrepo2
-  $ git init --bare | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo2/
-  
+  $ git init --bare
+  Initialized empty Git repository in $TESTTMP/gitrepo2/
 
 dulwich does not presently support local git repos, workaround
   $ cd ..
diff --git a/tests/test-octopus.t b/tests/test-octopus.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC1vY3RvcHVzLnQ=..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC1vY3RvcHVzLnQ= 100755
--- a/tests/test-octopus.t
+++ b/tests/test-octopus.t
@@ -29,9 +29,8 @@
 
   $ mkdir gitrepo
   $ cd gitrepo
-  $ git init | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo/.git/
-  
+  $ git init
+  Initialized empty Git repository in $TESTTMP/gitrepo/.git/
 
   $ echo alpha > alpha
   $ git add alpha
@@ -68,9 +67,8 @@
   $ cd ..
   $ mkdir gitrepo2
   $ cd gitrepo2
-  $ git init --bare | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo2/
-  
+  $ git init --bare
+  Initialized empty Git repository in $TESTTMP/gitrepo2/
 
 dulwich does not presently support local git repos, workaround
   $ cd ..
diff --git a/tests/test-outgoing.t b/tests/test-outgoing.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC1vdXRnb2luZy50..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC1vdXRnb2luZy50 100755
--- a/tests/test-outgoing.t
+++ b/tests/test-outgoing.t
@@ -32,9 +32,8 @@
 
   $ mkdir gitrepo
   $ cd gitrepo
-  $ git init | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo/.git/
-  
+  $ git init
+  Initialized empty Git repository in $TESTTMP/gitrepo/.git/
 
   $ echo alpha > alpha
   $ git add alpha
diff --git a/tests/test-pull-after-strip.t b/tests/test-pull-after-strip.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC1wdWxsLWFmdGVyLXN0cmlwLnQ=..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC1wdWxsLWFmdGVyLXN0cmlwLnQ= 100755
--- a/tests/test-pull-after-strip.t
+++ b/tests/test-pull-after-strip.t
@@ -43,9 +43,8 @@
 
   $ mkdir gitrepo
   $ cd gitrepo
-  $ git init | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo/.git/
-  
+  $ git init
+  Initialized empty Git repository in $TESTTMP/gitrepo/.git/
   $ echo alpha > alpha
   $ git add alpha
   $ commit -m 'add alpha'
diff --git a/tests/test-pull.t b/tests/test-pull.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC1wdWxsLnQ=..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC1wdWxsLnQ= 100755
--- a/tests/test-pull.t
+++ b/tests/test-pull.t
@@ -29,9 +29,8 @@
 
   $ mkdir gitrepo
   $ cd gitrepo
-  $ git init | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo/.git/
-  
+  $ git init
+  Initialized empty Git repository in $TESTTMP/gitrepo/.git/
   $ echo alpha > alpha
   $ git add alpha
   $ commit -m 'add alpha'
diff --git a/tests/test-push.t b/tests/test-push.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC1wdXNoLnQ=..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC1wdXNoLnQ= 100755
--- a/tests/test-push.t
+++ b/tests/test-push.t
@@ -35,9 +35,8 @@
 
   $ mkdir gitrepo
   $ cd gitrepo
-  $ git init | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo/.git/
-  
+  $ git init
+  Initialized empty Git repository in $TESTTMP/gitrepo/.git/
 
   $ echo alpha > alpha
   $ git add alpha
diff --git a/tests/test-tree-decomposition.t b/tests/test-tree-decomposition.t
index bc7b18c2e5ef9119d6e85a584c69ff5b60ded801_dGVzdHMvdGVzdC10cmVlLWRlY29tcG9zaXRpb24udA==..e48a3f30b73c194b2d0968753f71dab39614c7dc_dGVzdHMvdGVzdC10cmVlLWRlY29tcG9zaXRpb24udA== 100755
--- a/tests/test-tree-decomposition.t
+++ b/tests/test-tree-decomposition.t
@@ -28,9 +28,8 @@
 
   $ mkdir gitrepo
   $ cd gitrepo
-  $ git init | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo/.git/
-  
+  $ git init
+  Initialized empty Git repository in $TESTTMP/gitrepo/.git/
 
   $ mkdir d1
   $ echo a > d1/f1
@@ -51,9 +50,8 @@
   $ cd ..
   $ mkdir gitrepo2
   $ cd gitrepo2
-  $ git init --bare | python -c "import sys; print sys.stdin.read().replace('$(dirname $(pwd))/', '')"
-  Initialized empty Git repository in gitrepo2/
-  
+  $ git init --bare
+  Initialized empty Git repository in $TESTTMP/gitrepo2/
 
 dulwich does not presently support local git repos, workaround
   $ cd ..