changeset 528:e48a3f30b73c

tests: remove piping of command git init to remove leading path In many cases we were piping to a python script to strip out the varying leading path to the test repos. This is no longer needed, as the modern run-test.py automatically substitutes the leading path as $TESTTMP. Eliminating the piping makes the tests easier to read and write, as well as allowing the exit codes to be verified by the test.
author David M. Carr <david@carrclan.us>
date Thu, 13 Sep 2012 20:49:42 -0400
parents bc7b18c2e5ef
children 7edcbdd2ef2f
files tests/test-conflict-1.t tests/test-conflict-2.t tests/test-convergedmerge.t tests/test-empty-working-tree.t tests/test-encoding.t tests/test-file-removal.t tests/test-git-clone.t tests/test-git-submodules.t tests/test-git-tags.t tests/test-hg-author.t tests/test-hg-branch.t tests/test-hg-tags.t tests/test-incoming.t tests/test-keywords.t tests/test-merge.t tests/test-octopus.t tests/test-outgoing.t tests/test-pull-after-strip.t tests/test-pull.t tests/test-push.t tests/test-tree-decomposition.t
diffstat 21 files changed, 56 insertions(+), 84 deletions(-) [+]
line wrap: on
line diff
--- 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 ..
--- 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 ..
--- 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 ..
--- a/tests/test-empty-working-tree.t
+++ b/tests/test-empty-working-tree.t
@@ -19,18 +19,16 @@
 
   $ 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
-  $ 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 ..
--- 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 ..
--- 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 ..
--- 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'
--- 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'
--- 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
--- 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
--- 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
--- 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
--- 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
--- 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'
--- 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 ..
--- 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 ..
--- 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
--- 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'
--- 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'
--- 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
--- 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 ..