t / t9118-git-svn-funky-branch-names.shon commit Merge branch 'maint' (379e48f)
   1#!/bin/sh
   2#
   3# Copyright (c) 2007 Eric Wong
   4#
   5
   6test_description='git svn funky branch names'
   7. ./lib-git-svn.sh
   8
   9# Abo-Uebernahme (Bug #994)
  10scary_uri='Abo-Uebernahme%20%28Bug%20%23994%29'
  11scary_ref='Abo-Uebernahme%20(Bug%20#994)'
  12
  13test_expect_success 'setup svnrepo' '
  14        mkdir project project/trunk project/branches project/tags &&
  15        echo foo > project/trunk/foo &&
  16        svn_cmd import -m "$test_description" project "$svnrepo/pr ject" &&
  17        rm -rf project &&
  18        svn_cmd cp -m "fun" "$svnrepo/pr ject/trunk" \
  19                        "$svnrepo/pr ject/branches/fun plugin" &&
  20        svn_cmd cp -m "more fun!" "$svnrepo/pr ject/branches/fun plugin" \
  21                              "$svnrepo/pr ject/branches/more fun plugin!" &&
  22        svn_cmd cp -m "scary" "$svnrepo/pr ject/branches/fun plugin" \
  23                      "$svnrepo/pr ject/branches/$scary_uri" &&
  24        svn_cmd cp -m "leading dot" "$svnrepo/pr ject/trunk" \
  25                        "$svnrepo/pr ject/branches/.leading_dot" &&
  26        svn_cmd cp -m "trailing dot" "$svnrepo/pr ject/trunk" \
  27                        "$svnrepo/pr ject/branches/trailing_dot." &&
  28        svn_cmd cp -m "trailing .lock" "$svnrepo/pr ject/trunk" \
  29                        "$svnrepo/pr ject/branches/trailing_dotlock.lock" &&
  30        svn_cmd cp -m "reflog" "$svnrepo/pr ject/trunk" \
  31                        "$svnrepo/pr ject/branches/not-a@{0}reflog" &&
  32        start_httpd
  33        '
  34
  35test_expect_success 'test clone with funky branch names' '
  36        git svn clone -s "$svnrepo/pr ject" project &&
  37        cd project &&
  38                git rev-parse "refs/remotes/fun%20plugin" &&
  39                git rev-parse "refs/remotes/more%20fun%20plugin!" &&
  40                git rev-parse "refs/remotes/$scary_ref" &&
  41                git rev-parse "refs/remotes/%2Eleading_dot" &&
  42                git rev-parse "refs/remotes/trailing_dot%2E" &&
  43                git rev-parse "refs/remotes/trailing_dotlock%2Elock" &&
  44                git rev-parse "refs/remotes/not-a%40{0}reflog" &&
  45        cd ..
  46        '
  47
  48test_expect_success 'test dcommit to funky branch' "
  49        cd project &&
  50        git reset --hard 'refs/remotes/more%20fun%20plugin!' &&
  51        echo hello >> foo &&
  52        git commit -m 'hello' -- foo &&
  53        git svn dcommit &&
  54        cd ..
  55        "
  56
  57test_expect_success 'test dcommit to scary branch' '
  58        cd project &&
  59        git reset --hard "refs/remotes/$scary_ref" &&
  60        echo urls are scary >> foo &&
  61        git commit -m "eep" -- foo &&
  62        git svn dcommit &&
  63        cd ..
  64        '
  65
  66test_expect_success 'test dcommit to trailing_dotlock branch' '
  67        cd project &&
  68        git reset --hard "refs/remotes/trailing_dotlock%2Elock" &&
  69        echo who names branches like this anyway? >> foo &&
  70        git commit -m "bar" -- foo &&
  71        git svn dcommit &&
  72        cd ..
  73        '
  74
  75stop_httpd
  76
  77test_done