Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t9117-git-svn-init-clone.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t9117-git-svn-init-clone.sh` 122 lines ยท 3264 bytes Raw Blame History 1 #!/bin/sh 2 # 3 # Copyright (c) 2007 Eric Wong 4 # 5 6 test_description='git svn init/clone tests' 7 8 . ./lib-git-svn.sh 9 10 test_expect_success 'setup svnrepo' ' 11 mkdir project project/trunk project/branches project/tags && 12 echo foo > project/trunk/foo && 13 svn_cmd import -m "$test_description" project "$svnrepo"/project && 14 rm -rf project 15 ' 16 17 test_expect_success 'basic clone' ' 18 test ! -d trunk && 19 git svn clone "$svnrepo"/project/trunk && 20 test_path_is_dir trunk/.git/svn && 21 test_path_exists trunk/foo && 22 rm -rf trunk 23 ' 24 25 test_expect_success 'clone to target directory' ' 26 test ! -d target && 27 git svn clone "$svnrepo"/project/trunk target && 28 test_path_is_dir target/.git/svn && 29 test_path_exists target/foo && 30 rm -rf target 31 ' 32 33 test_expect_success 'clone with --stdlayout' ' 34 test ! -d project && 35 git svn clone -s "$svnrepo"/project && 36 test_path_is_dir project/.git/svn && 37 test_path_exists project/foo && 38 rm -rf project 39 ' 40 41 test_expect_success 'clone to target directory with --stdlayout' ' 42 test ! -d target && 43 git svn clone -s "$svnrepo"/project target && 44 test_path_is_dir target/.git/svn && 45 test_path_exists target/foo && 46 rm -rf target 47 ' 48 49 test_expect_success 'init without -s/-T/-b/-t does not warn' ' 50 test ! -d trunk && 51 git svn init "$svnrepo"/project/trunk trunk 2>warning && 52 test_grep ! -q prefix warning && 53 rm -rf trunk && 54 rm -f warning 55 ' 56 57 test_expect_success 'clone without -s/-T/-b/-t does not warn' ' 58 test ! -d trunk && 59 git svn clone "$svnrepo"/project/trunk 2>warning && 60 test_grep ! -q prefix warning && 61 rm -rf trunk && 62 rm -f warning 63 ' 64 65 test_svn_configured_prefix () { 66 prefix=$1 && 67 cat >expect <>actual && 74 git --git-dir=project/.git config svn-remote.svn.branches >>actual && 75 git --git-dir=project/.git config svn-remote.svn.tags >>actual && 76 test_cmp expect actual && 77 rm -f expect actual 78 } 79 80 test_expect_success 'init with -s/-T/-b/-t assumes --prefix=origin/' ' 81 test ! -d project && 82 git svn init -s "$svnrepo"/project project 2>warning && 83 test_grep ! -q prefix warning && 84 test_svn_configured_prefix "origin/" && 85 rm -rf project && 86 rm -f warning 87 ' 88 89 test_expect_success 'clone with -s/-T/-b/-t assumes --prefix=origin/' ' 90 test ! -d project && 91 git svn clone -s "$svnrepo"/project 2>warning && 92 test_grep ! -q prefix warning && 93 test_svn_configured_prefix "origin/" && 94 rm -rf project && 95 rm -f warning 96 ' 97 98 test_expect_success 'init with -s/-T/-b/-t and --prefix "" still works' ' 99 test ! -d project && 100 git svn init -s "$svnrepo"/project project --prefix "" 2>warning && 101 test_grep ! -q prefix warning && 102 test_svn_configured_prefix "" && 103 rm -rf project && 104 rm -f warning 105 ' 106 107 test_expect_success 'clone with -s/-T/-b/-t and --prefix "" still works' ' 108 test ! -d project && 109 git svn clone -s "$svnrepo"/project --prefix "" 2>warning && 110 test_grep ! -q prefix warning && 111 test_svn_configured_prefix "" && 112 rm -rf project && 113 rm -f warning 114 ' 115 116 test_expect_success 'init with -T as a full url works' ' 117 test ! -d project && 118 git svn init -T "$svnrepo"/project/trunk project && 119 rm -rf project 120 ' 121 122 test_done