Merge branch 'bd/tests'
authorJunio C Hamano <gitster@pobox.com>
Wed, 14 May 2008 20:45:16 +0000 (13:45 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 May 2008 20:45:16 +0000 (13:45 -0700)
* bd/tests:
Rename the test trash directory to contain spaces.
Fix tests breaking when checkout path contains shell metacharacters
Don't use the 'export NAME=value' in the test scripts.
lib-git-svn.sh: Fix quoting issues with paths containing shell metacharacters
test-lib.sh: Fix some missing path quoting
Use test_set_editor in t9001-send-email.sh
test-lib.sh: Add a test_set_editor function to safely set $VISUAL
git-send-email.perl: Handle shell metacharacters in $EDITOR properly
config.c: Escape backslashes in section names properly
git-rebase.sh: Fix --merge --abort failures when path contains whitespace

Conflicts:

t/t9115-git-svn-dcommit-funky-renames.sh

1  2 
config.c
git-rebase.sh
git-send-email.perl
t/lib-git-svn.sh
t/t3400-rebase.sh
t/t6200-fmt-merge-msg.sh
t/t7003-filter-branch.sh
t/t7501-commit.sh
t/t9001-send-email.sh
t/t9115-git-svn-dcommit-funky-renames.sh
diff --combined config.c
index 0e22c7a6423c211b2e2a95b0535b85dc9f234a1f,f0ac4569a33630e20d6e7531d50eee55cf0dd9d4..e42ada78f8b10e7fb5600a6c99f81f27accd42fa
+++ b/config.c
@@@ -350,11 -350,6 +350,11 @@@ int git_default_config(const char *var
                return 0;
        }
  
 +      if (!strcmp(var, "core.ignorecase")) {
 +              ignore_case = git_config_bool(var, value);
 +              return 0;
 +      }
 +
        if (!strcmp(var, "core.bare")) {
                is_bare_repository_cfg = git_config_bool(var, value);
                return 0;
                git_branch_track = git_config_bool(var, value);
                return 0;
        }
 +      if (!strcmp(var, "branch.autosetuprebase")) {
 +              if (!value)
 +                      return config_error_nonbool(var);
 +              else if (!strcmp(value, "never"))
 +                      autorebase = AUTOREBASE_NEVER;
 +              else if (!strcmp(value, "local"))
 +                      autorebase = AUTOREBASE_LOCAL;
 +              else if (!strcmp(value, "remote"))
 +                      autorebase = AUTOREBASE_REMOTE;
 +              else if (!strcmp(value, "always"))
 +                      autorebase = AUTOREBASE_ALWAYS;
 +              else
 +                      return error("Malformed value for %s", var);
 +              return 0;
 +      }
  
        /* Add other config variables here and to Documentation/config.txt. */
        return 0;
@@@ -627,9 -607,11 +627,9 @@@ static int store_aux(const char* key, c
        case KEY_SEEN:
                if (matches(key, value)) {
                        if (store.seen == 1 && store.multi_replace == 0) {
 -                              fprintf(stderr,
 -                                      "Warning: %s has multiple values\n",
 -                                      key);
 +                              warning("%s has multiple values", key);
                        } else if (store.seen >= MAX_MATCHES) {
 -                              fprintf(stderr, "Too many matches\n");
 +                              error("too many matches for %s", key);
                                return 1;
                        }
  
        return 0;
  }
  
 -static int write_error(void)
 +static int write_error(const char *filename)
  {
 -      fprintf(stderr, "Failed to write new configuration file\n");
 +      error("failed to write new configuration file %s", filename);
  
        /* Same error code as "failed to rename". */
        return 4;
@@@ -698,7 -680,7 +698,7 @@@ static int store_write_section(int fd, 
        if (dot) {
                strbuf_addf(&sb, "[%.*s \"", (int)(dot - key), key);
                for (i = dot - key + 1; i < store.baselen; i++) {
-                       if (key[i] == '"')
+                       if (key[i] == '"' || key[i] == '\\')
                                strbuf_addch(&sb, '\\');
                        strbuf_addch(&sb, key[i]);
                }
@@@ -840,7 -822,7 +840,7 @@@ int git_config_set_multivar(const char
         */
  
        if (last_dot == NULL) {
 -              fprintf(stderr, "key does not contain a section: %s\n", key);
 +              error("key does not contain a section: %s", key);
                ret = 2;
                goto out_free;
        }
                /* Leave the extended basename untouched.. */
                if (!dot || i > store.baselen) {
                        if (!iskeychar(c) || (i == store.baselen+1 && !isalpha(c))) {
 -                              fprintf(stderr, "invalid key: %s\n", key);
 +                              error("invalid key: %s", key);
                                free(store.key);
                                ret = 1;
                                goto out_free;
                        }
                        c = tolower(c);
                } else if (c == '\n') {
 -                      fprintf(stderr, "invalid key (newline): %s\n", key);
 +                      error("invalid key (newline): %s", key);
                        free(store.key);
                        ret = 1;
                        goto out_free;
        lock = xcalloc(sizeof(struct lock_file), 1);
        fd = hold_lock_file_for_update(lock, config_filename, 0);
        if (fd < 0) {
 -              fprintf(stderr, "could not lock config file\n");
 +              error("could not lock config file %s", config_filename);
                free(store.key);
                ret = -1;
                goto out_free;
                        store.value_regex = (regex_t*)xmalloc(sizeof(regex_t));
                        if (regcomp(store.value_regex, value_regex,
                                        REG_EXTENDED)) {
 -                              fprintf(stderr, "Invalid pattern: %s\n",
 -                                      value_regex);
 +                              error("invalid pattern: %s", value_regex);
                                free(store.value_regex);
                                ret = 6;
                                goto out_free;
                 * existing config file.
                 */
                if (git_config_from_file(store_aux, config_filename)) {
 -                      fprintf(stderr, "invalid config file\n");
 +                      error("invalid config file %s", config_filename);
                        free(store.key);
                        if (store.value_regex != NULL) {
                                regfree(store.value_regex);
        }
  
        if (commit_lock_file(lock) < 0) {
 -              fprintf(stderr, "Cannot commit config file!\n");
 +              error("could not commit config file %s", config_filename);
                ret = 4;
                goto out_free;
        }
@@@ -1048,7 -1031,7 +1048,7 @@@ out_free
        return ret;
  
  write_err_out:
 -      ret = write_error();
 +      ret = write_error(lock->filename);
        goto out_free;
  
  }
@@@ -1098,7 -1081,7 +1098,7 @@@ int git_config_rename_section(const cha
        config_filename = xstrdup(config_filename);
        out_fd = hold_lock_file_for_update(lock, config_filename, 0);
        if (out_fd < 0) {
 -              ret = error("Could not lock config file!");
 +              ret = error("could not lock config file %s", config_filename);
                goto out;
        }
  
                                }
                                store.baselen = strlen(new_name);
                                if (!store_write_section(out_fd, new_name)) {
 -                                      ret = write_error();
 +                                      ret = write_error(lock->filename);
                                        goto out;
                                }
                                continue;
                        continue;
                length = strlen(buf);
                if (write_in_full(out_fd, buf, length) != length) {
 -                      ret = write_error();
 +                      ret = write_error(lock->filename);
                        goto out;
                }
        }
        fclose(config_file);
   unlock_and_out:
        if (commit_lock_file(lock) < 0)
 -                      ret = error("Cannot commit config file!");
 +              ret = error("could not commit config file %s", config_filename);
   out:
        free(config_filename);
        return ret;
diff --combined git-rebase.sh
index fbb0f288b3243bad5c358c6e8ecfb351aeaa52e8,c43afe51abe065950f3d3ba2aa71bb157dd04bc8..68855c18ae62ef6f4a3fdacb6f8de9c57511aa79
@@@ -214,7 -214,7 +214,7 @@@ d
                else
                        die "No rebase in progress?"
                fi
-               git reset --hard $(cat $dotest/orig-head)
+               git reset --hard $(cat "$dotest/orig-head")
                rm -r "$dotest"
                exit
                ;;
@@@ -353,7 -353,7 +353,7 @@@ orig_head=$branc
  mb=$(git merge-base "$onto" "$branch")
  if test "$upstream" = "$onto" && test "$mb" = "$onto" &&
        # linear history?
 -      ! git rev-list --parents "$onto".."$branch" | grep " .* " > /dev/null
 +      ! (git rev-list --parents "$onto".."$branch" | grep " .* ") > /dev/null
  then
        # Lazily switch to the target branch if needed...
        test -z "$switch_to" || git checkout "$switch_to"
diff --combined git-send-email.perl
index cb05cf5b9ebc41c6d95067037605154c5a83e9b1,b50239636dab4a5f64f4c3d4f8321fc954b3f1a1..1e1d98656d645371612cac02abad4ea33757d40e
@@@ -203,7 -203,6 +203,7 @@@ my %config_settings = 
      "smtpuser" => \$smtp_authuser,
      "smtppass" => \$smtp_authpass,
      "to" => \@to,
 +    "cc" => \@initial_cc,
      "cccmd" => \$cc_cmd,
      "aliasfiletype" => \$aliasfiletype,
      "bcc" => \@bcclist,
@@@ -513,7 -512,7 +513,7 @@@ EO
        close(C);
  
        my $editor = $ENV{GIT_EDITOR} || Git::config(@repo, "core.editor") || $ENV{VISUAL} || $ENV{EDITOR} || "vi";
-       system('sh', '-c', '$0 $@', $editor, $compose_filename);
+       system('sh', '-c', $editor.' "$@"', $editor, $compose_filename);
  
        open(C2,">",$compose_filename . ".final")
                or die "Failed to open $compose_filename.final : " . $!;
diff --combined t/lib-git-svn.sh
index d8f33557911389ab0e179b70e27d85264ef5ca0a,445df78cac05230df89a3efb1d5753589400aa32..5d3bd9dda916d454997da0015c35d0fa7d9f72c0
@@@ -20,12 -20,13 +20,13 @@@ the
  fi
  
  svnrepo=$PWD/svnrepo
+ export svnrepo
  
  perl -w -e "
  use SVN::Core;
  use SVN::Repos;
  \$SVN::Core::VERSION gt '1.1.0' or exit(42);
- system(qw/svnadmin create --fs-type fsfs/, '$svnrepo') == 0 or exit(41);
+ system(qw/svnadmin create --fs-type fsfs/, \$ENV{svnrepo}) == 0 or exit(41);
  " >&3 2>&4
  x=$?
  if test $x -ne 0
@@@ -73,16 -74,11 +74,16 @@@ for d in 
  done
  
  start_httpd () {
 +      repo_base_path="$1"
        if test -z "$SVN_HTTPD_PORT"
        then
                echo >&2 'SVN_HTTPD_PORT is not defined!'
                return
        fi
 +      if test -z "$repo_base_path"
 +      then
 +              repo_base_path=svn
 +      fi
  
        mkdir "$GIT_DIR"/logs
  
@@@ -95,13 -91,13 +96,13 @@@ LockFile logs/accept.loc
  Listen 127.0.0.1:$SVN_HTTPD_PORT
  LoadModule dav_module $SVN_HTTPD_MODULE_PATH/mod_dav.so
  LoadModule dav_svn_module $SVN_HTTPD_MODULE_PATH/mod_dav_svn.so
 -<Location /svn>
 +<Location /$repo_base_path>
        DAV svn
        SVNPath $rawsvnrepo
  </Location>
  EOF
        "$SVN_HTTPD_PATH" -f "$GIT_DIR"/httpd.conf -k start
 -      svnrepo=http://127.0.0.1:$SVN_HTTPD_PORT/svn
 +      svnrepo="http://127.0.0.1:$SVN_HTTPD_PORT/$repo_base_path"
  }
  
  stop_httpd () {
diff --combined t/t3400-rebase.sh
index fdad7dad611b385f05779826bfa74f33d1f28d03,10d7449b54b0f64d559f73435887fce17277b667..91bb5e1d9eea0b2f1ff7a1120d97ca2876a8f277
@@@ -9,7 -9,8 +9,8 @@@ This test runs git rebase and checks th
  '
  . ./test-lib.sh
  
- export GIT_AUTHOR_EMAIL=bogus_email_address
+ GIT_AUTHOR_EMAIL=bogus_email_address
+ export GIT_AUTHOR_EMAIL
  
  test_expect_success \
      'prepare repository with topic branches' \
@@@ -44,13 -45,13 +45,13 @@@ test_expect_success 'rebase against mas
  
  test_expect_success \
      'the rebase operation should not have destroyed author information' \
 -    '! git log | grep "Author:" | grep "<>"'
 +    '! (git log | grep "Author:" | grep "<>")'
  
  test_expect_success 'rebase after merge master' '
       git reset --hard topic &&
       git merge master &&
       git rebase master &&
 -     ! git show | grep "^Merge:"
 +     ! (git show | grep "^Merge:")
  '
  
  test_expect_success 'rebase of history with merges is linearized' '
diff --combined t/t6200-fmt-merge-msg.sh
index bd4e49bf1e979a9b260a2aa23be60d15c911397a,9c0b92632cd815504f229823db3135e3ffcdbc1b..c9bf6fdba3c3495b5215394d568fd8ac5b4f6daf
@@@ -82,14 -82,14 +82,14 @@@ test_expect_success 'merge-msg test #1
        git diff actual expected
  '
  
- cat >expected <<\EOF
- Merge branch 'left' of ../trash
+ cat >expected <<EOF
+ Merge branch 'left' of ../$test
  EOF
  
  test_expect_success 'merge-msg test #2' '
  
        git checkout master &&
-       git fetch ../trash left &&
+       git fetch ../"$test" left &&
  
        git fmt-merge-msg <.git/FETCH_HEAD >actual &&
        git diff actual expected
@@@ -106,24 -106,8 +106,24 @@@ Merge branch 'left
    Common #1
  EOF
  
 -test_expect_success 'merge-msg test #3' '
 +test_expect_success 'merge-msg test #3-1' '
  
 +      git config --unset-all merge.log
 +      git config --unset-all merge.summary
 +      git config merge.log true &&
 +
 +      git checkout master &&
 +      setdate &&
 +      git fetch . left &&
 +
 +      git fmt-merge-msg <.git/FETCH_HEAD >actual &&
 +      git diff actual expected
 +'
 +
 +test_expect_success 'merge-msg test #3-2' '
 +
 +      git config --unset-all merge.log
 +      git config --unset-all merge.summary
        git config merge.summary true &&
  
        git checkout master &&
@@@ -152,24 -136,8 +152,24 @@@ Merge branches 'left' and 'right
    Common #1
  EOF
  
 -test_expect_success 'merge-msg test #4' '
 +test_expect_success 'merge-msg test #4-1' '
 +
 +      git config --unset-all merge.log
 +      git config --unset-all merge.summary
 +      git config merge.log true &&
 +
 +      git checkout master &&
 +      setdate &&
 +      git fetch . left right &&
 +
 +      git fmt-merge-msg <.git/FETCH_HEAD >actual &&
 +      git diff actual expected
 +'
 +
 +test_expect_success 'merge-msg test #4-2' '
  
 +      git config --unset-all merge.log
 +      git config --unset-all merge.summary
        git config merge.summary true &&
  
        git checkout master &&
        git diff actual expected
  '
  
 -test_expect_success 'merge-msg test #5' '
 +test_expect_success 'merge-msg test #5-1' '
 +
 +      git config --unset-all merge.log
 +      git config --unset-all merge.summary
 +      git config merge.log yes &&
 +
 +      git checkout master &&
 +      setdate &&
 +      git fetch . left right &&
 +
 +      git fmt-merge-msg <.git/FETCH_HEAD >actual &&
 +      git diff actual expected
 +'
 +
 +test_expect_success 'merge-msg test #5-2' '
  
 +      git config --unset-all merge.log
 +      git config --unset-all merge.summary
        git config merge.summary yes &&
  
        git checkout master &&
diff --combined t/t7003-filter-branch.sh
index 16df3d4adb1cc6bc970dd79829adbc46492bc66c,fd0903020844c87df3e45132810c5fae7d25a2d3..1639c7aa9624bf3219afd021daf14c6f07dcfc32
@@@ -125,7 -125,7 +125,7 @@@ test_expect_success 'use index-filter t
                 "git ls-files -s | sed \"s-\\t-&newsubdir/-\" |
                  GIT_INDEX_FILE=\$GIT_INDEX_FILE.new \
                        git update-index --index-info &&
-                 mv \$GIT_INDEX_FILE.new \$GIT_INDEX_FILE" directorymoved &&
+                 mv \"\$GIT_INDEX_FILE.new\" \"\$GIT_INDEX_FILE\"" directorymoved &&
        test -z "$(git diff HEAD directorymoved:newsubdir)"'
  
  test_expect_success 'stops when msg filter fails' '
@@@ -219,36 -219,4 +219,36 @@@ test_expect_success 'Subdirectory filte
        test $(git rev-list master | wc -l) = 3
  '
  
 +test_expect_success 'Tag name filtering retains tag message' '
 +      git tag -m atag T &&
 +      git cat-file tag T > expect &&
 +      git filter-branch -f --tag-name-filter cat &&
 +      git cat-file tag T > actual &&
 +      git diff expect actual
 +'
 +
 +faux_gpg_tag='object XXXXXX
 +type commit
 +tag S
 +tagger T A Gger <tagger@example.com> 1206026339 -0500
 +
 +This is a faux gpg signed tag.
 +-----BEGIN PGP SIGNATURE-----
 +Version: FauxGPG v0.0.0 (FAUX/Linux)
 +
 +gdsfoewhxu/6l06f1kxyxhKdZkrcbaiOMtkJUA9ITAc1mlamh0ooasxkH1XwMbYQ
 +acmwXaWET20H0GeAGP+7vow=
 +=agpO
 +-----END PGP SIGNATURE-----
 +'
 +test_expect_success 'Tag name filtering strips gpg signature' '
 +      sha1=$(git rev-parse HEAD) &&
 +      sha1t=$(echo "$faux_gpg_tag" | sed -e s/XXXXXX/$sha1/ | git mktag) &&
 +      git update-ref "refs/tags/S" "$sha1t" &&
 +      echo "$faux_gpg_tag" | sed -e s/XXXXXX/$sha1/ | head -n 6 > expect &&
 +      git filter-branch -f --tag-name-filter cat &&
 +      git cat-file tag S > actual &&
 +      git diff expect actual
 +'
 +
  test_done
diff --combined t/t7501-commit.sh
index 89710afcb5141beee6b02d8a67e66e11c6f15ad0,e5fdb638511e58e6206a5e44a873a8d3cfae7317..d3370ff7ff66240f14b8231de7ba0198e73e8deb
@@@ -41,7 -41,7 +41,7 @@@ test_expect_success 
  test_expect_success \
        "using paths with --interactive" \
        "echo bong-o-bong >file &&
 -      ! echo 7 | git-commit -m foo --interactive file"
 +      ! (echo 7 | git-commit -m foo --interactive file)"
  
  test_expect_success \
        "using invalid commit with -C" \
@@@ -79,8 -79,8 +79,8 @@@ test_expect_success 
  
  cat >editor <<\EOF
  #!/bin/sh
- sed -e "s/a file/an amend commit/g" < $1 > $1-
- mv $1- $1
+ sed -e "s/a file/an amend commit/g" < "$1" > "$1-"
+ mv "$1-" "$1"
  EOF
  chmod 755 editor
  
@@@ -99,8 -99,8 +99,8 @@@ test_expect_success 
  
  cat >editor <<\EOF
  #!/bin/sh
- sed -e "s/amend/older/g"  < $1 > $1-
- mv $1- $1
+ sed -e "s/amend/older/g"  < "$1" > "$1-"
+ mv "$1-" "$1"
  EOF
  chmod 755 editor
  
diff --combined t/t9001-send-email.sh
index af655cf526930734436ad6daee667e661c229a48,0a65785573495af32e0b42265d33b41e83d629c3..04baa61c0485377d033f4a10d2bb8ceeac1a4686
@@@ -139,15 -139,16 +139,16 @@@ test_expect_success 'Valid In-Reply-To 
  
  test_expect_success 'setup fake editor' '
        (echo "#!/bin/sh" &&
-        echo "echo fake edit >>\$1"
+        echo "echo fake edit >>\"\$1\""
        ) >fake-editor &&
        chmod +x fake-editor
  '
  
+ test_set_editor "$(pwd)/fake-editor"
  test_expect_success '--compose works' '
        clean_fake_sendmail &&
        echo y | \
-               GIT_EDITOR=$(pwd)/fake-editor \
                GIT_SEND_EMAIL_NOTTY=1 \
                git send-email \
                --compose --subject foo \
@@@ -166,70 -167,4 +167,70 @@@ test_expect_success 'second message is 
        grep "Subject:.*Second" msgtxt2
  '
  
 +cat >expected-show-all-headers <<\EOF
 +0001-Second.patch
 +(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
 +Dry-OK. Log says:
 +Server: relay.example.com
 +MAIL FROM:<from@example.com>
 +RCPT TO:<to@example.com>,<cc@example.com>,<author@example.com>
 +From: Example <from@example.com>
 +To: to@example.com
 +Cc: cc@example.com, A <author@example.com>
 +Subject: [PATCH 1/1] Second.
 +Date: DATE-STRING
 +Message-Id: MESSAGE-ID-STRING
 +X-Mailer: X-MAILER-STRING
 +
 +Result: OK
 +EOF
 +
 +test_expect_success 'sendemail.cc set' '
 +      git config sendemail.cc cc@example.com &&
 +      git send-email \
 +              --dry-run \
 +              --from="Example <from@example.com>" \
 +              --to=to@example.com \
 +              --smtp-server relay.example.com \
 +              $patches |
 +      sed     -e "s/^\(Date:\).*/\1 DATE-STRING/" \
 +              -e "s/^\(Message-Id:\).*/\1 MESSAGE-ID-STRING/" \
 +              -e "s/^\(X-Mailer:\).*/\1 X-MAILER-STRING/" \
 +              >actual-show-all-headers &&
 +      test_cmp expected-show-all-headers actual-show-all-headers
 +'
 +
 +cat >expected-show-all-headers <<\EOF
 +0001-Second.patch
 +(mbox) Adding cc: A <author@example.com> from line 'From: A <author@example.com>'
 +Dry-OK. Log says:
 +Server: relay.example.com
 +MAIL FROM:<from@example.com>
 +RCPT TO:<to@example.com>,<author@example.com>
 +From: Example <from@example.com>
 +To: to@example.com
 +Cc: A <author@example.com>
 +Subject: [PATCH 1/1] Second.
 +Date: DATE-STRING
 +Message-Id: MESSAGE-ID-STRING
 +X-Mailer: X-MAILER-STRING
 +
 +Result: OK
 +EOF
 +
 +test_expect_success 'sendemail.cc unset' '
 +      git config --unset sendemail.cc &&
 +      git send-email \
 +              --dry-run \
 +              --from="Example <from@example.com>" \
 +              --to=to@example.com \
 +              --smtp-server relay.example.com \
 +              $patches |
 +      sed     -e "s/^\(Date:\).*/\1 DATE-STRING/" \
 +              -e "s/^\(Message-Id:\).*/\1 MESSAGE-ID-STRING/" \
 +              -e "s/^\(X-Mailer:\).*/\1 X-MAILER-STRING/" \
 +              >actual-show-all-headers &&
 +      test_cmp expected-show-all-headers actual-show-all-headers
 +'
 +
  test_done
index 4acbcb0acdce7852ee1f416250b5939132a93ca1,298445f7d9f8d34ba14f11d7976feff5fb0cea42..f0fbd3aff7e63f64f8ba388db805013c43b4b22c
@@@ -7,16 -7,16 +7,16 @@@ test_description='git-svn dcommit can c
  
  . ./lib-git-svn.sh
  
- test_expect_success 'load repository with strange names' "
-       svnadmin load -q $rawsvnrepo < ../t9115/funky-names.dump &&
+ test_expect_success 'load repository with strange names' '
+       svnadmin load -q "$rawsvnrepo" < ../t9115/funky-names.dump &&
 -      start_httpd
 +      start_httpd gtk+
-       "
+       '
  
- test_expect_success 'init and fetch repository' "
-       git svn init $svnrepo &&
+ test_expect_success 'init and fetch repository' '
+       git svn init "$svnrepo" &&
        git svn fetch &&
        git reset --hard git-svn
-       "
+       '
  
  test_expect_success 'create file in existing ugly and empty dir' '
        mkdir "#{bad_directory_name}" &&
@@@ -49,39 -49,6 +49,39 @@@ test_expect_success 'rename pretty fil
        git svn dcommit
        '
  
- test_expect_success 'clone the repository to test rebase' "
-       git svn clone $svnrepo test-rebase &&
 +test_expect_success 'add a file with plus signs' '
 +      echo .. > +_+ &&
 +      git update-index --add +_+ &&
 +      git commit -m plus &&
 +      mkdir gtk+ &&
 +      git mv +_+ gtk+/_+_ &&
 +      git commit -m plus_dir &&
 +      git svn dcommit
 +      '
 +
-       "
++test_expect_success 'clone the repository to test rebase' '
++      git svn clone "$svnrepo" test-rebase &&
 +      cd test-rebase &&
 +              echo test-rebase > test-rebase &&
 +              git add test-rebase &&
 +              git commit -m test-rebase &&
 +              cd ..
- test_expect_success 'make a commit to test rebase' "
++      '
 +
-       "
++test_expect_success 'make a commit to test rebase' '
 +              echo test-rebase-main > test-rebase-main &&
 +              git add test-rebase-main &&
 +              git commit -m test-rebase-main &&
 +              git svn dcommit
- test_expect_success 'git-svn rebase works inside a fresh-cloned repository' "
++      '
 +
-       "
++test_expect_success 'git-svn rebase works inside a fresh-cloned repository' '
 +      cd test-rebase &&
 +              git svn rebase &&
 +              test -e test-rebase-main &&
 +              test -e test-rebase
++      '
 +
  stop_httpd
  
  test_done