t / t9120-git-svn-clone-with-percent-escapes.shon commit Merge branch 'gf/maint-sh-setup-nongit-ok' into maint (801bad3)
   1#!/bin/sh
   2#
   3# Copyright (c) 2008 Kevin Ballard
   4#
   5
   6test_description='git svn clone with percent escapes'
   7. ./lib-git-svn.sh
   8
   9test_expect_success 'setup svnrepo' '
  10        mkdir project project/trunk project/branches project/tags &&
  11        echo foo > project/trunk/foo &&
  12        svn_cmd import -m "$test_description" project "$svnrepo/pr ject" &&
  13        svn_cmd cp -m "branch" "$svnrepo/pr ject/trunk" \
  14          "$svnrepo/pr ject/branches/b" &&
  15        svn_cmd cp -m "tag" "$svnrepo/pr ject/trunk" \
  16          "$svnrepo/pr ject/tags/v1" &&
  17        rm -rf project &&
  18        start_httpd
  19'
  20
  21test_expect_success 'test clone with percent escapes' '
  22        git svn clone "$svnrepo/pr%20ject" clone &&
  23        cd clone &&
  24                git rev-parse refs/${remotes_git_svn} &&
  25        cd ..
  26'
  27
  28# SVN works either way, so should we...
  29
  30test_expect_success 'svn checkout with percent escapes' '
  31        svn_cmd checkout "$svnrepo/pr%20ject" svn.percent &&
  32        svn_cmd checkout "$svnrepo/pr%20ject/trunk" svn.percent.trunk
  33'
  34
  35test_expect_success 'svn checkout with space' '
  36        svn_cmd checkout "$svnrepo/pr ject" svn.space &&
  37        svn_cmd checkout "$svnrepo/pr ject/trunk" svn.space.trunk
  38'
  39
  40test_expect_success 'test clone trunk with percent escapes and minimize-url' '
  41        git svn clone --minimize-url "$svnrepo/pr%20ject/trunk" minimize &&
  42        (
  43                cd minimize &&
  44                git rev-parse refs/${remotes_git_svn}
  45        )
  46'
  47
  48test_expect_success 'test clone trunk with percent escapes' '
  49        git svn clone "$svnrepo/pr%20ject/trunk" trunk &&
  50        (
  51                cd trunk &&
  52                git rev-parse refs/${remotes_git_svn}
  53        )
  54'
  55
  56test_expect_success 'test clone --stdlayout with percent escapes' '
  57        git svn clone --stdlayout "$svnrepo/pr%20ject" percent &&
  58        (
  59                cd percent &&
  60                git rev-parse refs/remotes/trunk^0 &&
  61                git rev-parse refs/remotes/b^0 &&
  62                git rev-parse refs/remotes/tags/v1^0
  63        )
  64'
  65
  66test_expect_success 'test clone -s with unescaped space' '
  67        git svn clone -s "$svnrepo/pr ject" space &&
  68        (
  69                cd space &&
  70                git rev-parse refs/remotes/trunk^0 &&
  71                git rev-parse refs/remotes/b^0 &&
  72                git rev-parse refs/remotes/tags/v1^0
  73        )
  74'
  75
  76stop_httpd
  77
  78test_done