From: konglu@minatec.inpg.fr Date: Tue, 12 Jun 2012 21:34:48 GMT Subject: Re: [PATCH 3/6] Test file for git-remote-mediawiki clone Message-ID: <20120612233448.Horde.yFmTWnwdC4BP17X4iOBVZrA@webmail.minatec.grenoble-inp.fr> In-Reply-To: <1339535563-18958-3-git-send-email-simon.cathebras@ensimag.imag.fr> Simon Cathebras a écrit : > From: Guillaume Sasdy > > This patch provides some tests for the clone in use by > git-remote-mediawiki. > > Signed-off-by: Simon Cathebras > Signed-off-by: Simon Perrat > Signed-off-by: Guillaume Sasdy > Signed-off-by: Charles Roussel > Signed-off-by: Julien Khayat > Signed-off-by: Matthieu Moy > --- > contrib/mw-to-git/t/t9360-mw-to-git-clone.sh | 238 > +++++++++++++++++++++++++++ > 1 file changed, 238 insertions(+) > create mode 100755 contrib/mw-to-git/t/t9360-mw-to-git-clone.sh > > diff --git a/contrib/mw-to-git/t/t9360-mw-to-git-clone.sh > b/contrib/mw-to-git/t/t9360-mw-to-git-clone.sh > new file mode 100755 > index 0000000..07e1270 > --- /dev/null > +++ b/contrib/mw-to-git/t/t9360-mw-to-git-clone.sh > @@ -0,0 +1,238 @@ > +#!/bin/sh > +# > +# Copyright (C) 2012 > +# Charles Roussel > +# Simon Cathebras > +# Julien Khayat > +# Guillaume Sasdy > +# Simon Perrat > +# > +# License: GPL v2 or later > + > + > +test_description='Test the Git Mediawiki remote helper: git clone' > + > +. ./test-gitmw-lib.sh > +. $TEST_DIRECTORY/test-lib.sh > + > + > +test_check_precond > + > + > +test_expect_success 'Git clone creates the git log expected with one file' ' > + wiki_reset && > + wiki_editpage foo "this is not important" false -c cat -s "this > must be the same" && > + git clone mediawiki::http://'"$SERVER_ADDR:$PORT/$WIKI_DIR_NAME"' > mw_dir_1 && > + (cd mw_dir_1 && > + git log --format=%s HEAD^..HEAD > log.tmp ) && > + echo "this must be the same" > msg.tmp && > + diff -b mw_dir_1/log.tmp msg.tmp > +' It's clearer to put it this way: git clone [...] && ( cd ... && .... ) && .... And, about style: "echo one >one" and not "echo one > one"