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/t9168-git-svn-partially-globbed-names.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 / t9168-git-svn-partially-globbed-names.sh` 229 lines ยท 7876 bytes Raw Blame History 1 #!/bin/sh 2 test_description='git svn globbing refspecs with prefixed globs' 3 . ./lib-git-svn.sh 4 5 test_expect_success 'prepare test refspec prefixed globbing' ' 6 cat >expect.end <trunk/src/a/readme && 17 echo "goodbye world" >trunk/src/b/readme && 18 svn_cmd import -m "initial" trunk "$svnrepo"/trunk && 19 svn_cmd co "$svnrepo" tmp && 20 ( 21 cd tmp && 22 mkdir branches tags && 23 svn_cmd add branches tags && 24 svn_cmd cp trunk branches/b_start && 25 svn_cmd commit -m "start a new branch" && 26 svn_cmd up && 27 echo "hi" >>branches/b_start/src/b/readme && 28 poke branches/b_start/src/b/readme && 29 echo "hey" >>branches/b_start/src/a/readme && 30 poke branches/b_start/src/a/readme && 31 svn_cmd commit -m "hi" && 32 svn_cmd up && 33 svn_cmd cp branches/b_start tags/t_end && 34 echo "bye" >>tags/t_end/src/b/readme && 35 poke tags/t_end/src/b/readme && 36 echo "aye" >>tags/t_end/src/a/readme && 37 poke tags/t_end/src/a/readme && 38 svn_cmd commit -m "the end" && 39 echo "byebye" >>tags/t_end/src/b/readme && 40 poke tags/t_end/src/b/readme && 41 svn_cmd commit -m "nothing to see here" 42 ) && 43 git config --add svn-remote.svn.url "$svnrepo" && 44 git config --add svn-remote.svn.fetch \ 45 "trunk/src/a:refs/remotes/trunk" && 46 git config --add svn-remote.svn.branches \ 47 "branches/b_*/src/a:refs/remotes/branches/b_*" && 48 git config --add svn-remote.svn.tags\ 49 "tags/t_*/src/a:refs/remotes/tags/t_*" && 50 git svn multi-fetch && 51 git log --pretty=oneline refs/remotes/tags/t_end >actual && 52 cut -d" " -f2- actual >output.end && 53 test_cmp expect.end output.end && 54 test "$(git rev-parse refs/remotes/tags/t_end~1)" = \ 55 "$(git rev-parse refs/remotes/branches/b_start)" && 56 test "$(git rev-parse refs/remotes/branches/b_start~2)" = \ 57 "$(git rev-parse refs/remotes/trunk)" && 58 test_must_fail git rev-parse refs/remotes/tags/t_end@3 59 ' 60 61 test_expect_success 'prepare test left-hand-side only prefixed globbing' ' 62 echo try to try >expect.two && 63 echo nothing to see here >>expect.two && 64 cat expect.end >>expect.two 65 ' 66 67 test_expect_success 'test left-hand-side only prefixed globbing' ' 68 git config --add svn-remote.two.url "$svnrepo" && 69 git config --add svn-remote.two.fetch trunk:refs/remotes/two/trunk && 70 git config --add svn-remote.two.branches \ 71 "branches/b_*:refs/remotes/two/branches/*" && 72 git config --add svn-remote.two.tags \ 73 "tags/t_*:refs/remotes/two/tags/*" && 74 ( 75 cd tmp && 76 echo "try try" >>tags/t_end/src/b/readme && 77 poke tags/t_end/src/b/readme && 78 svn_cmd commit -m "try to try" 79 ) && 80 git svn fetch two && 81 git rev-list refs/remotes/two/tags/t_end >actual && 82 test_line_count = 6 actual && 83 git rev-list refs/remotes/two/branches/b_start >actual && 84 test_line_count = 3 actual && 85 test $(git rev-parse refs/remotes/two/branches/b_start~2) = \ 86 $(git rev-parse refs/remotes/two/trunk) && 87 test $(git rev-parse refs/remotes/two/tags/t_end~3) = \ 88 $(git rev-parse refs/remotes/two/branches/b_start) && 89 git log --pretty=oneline refs/remotes/two/tags/t_end >actual && 90 cut -d" " -f2- actual >output.two && 91 test_cmp expect.two output.two 92 ' 93 94 test_expect_success 'prepare test prefixed globs match just prefix' ' 95 cat >expect.three <>branches/b_/src/a/readme && 114 poke branches/b_/src/a/readme && 115 svn_cmd commit -m "Branch commit to b_" && 116 svn_cmd up && svn_cmd cp branches/b_ tags/t_ && 117 echo "Tag commit to t_" >>tags/t_/src/a/readme && 118 poke tags/t_/src/a/readme && 119 svn_cmd commit -m "Tag commit to t_" && 120 svn_cmd up 121 ) && 122 git svn fetch three && 123 git rev-list refs/remotes/three/branches/b_ >actual && 124 test_line_count = 2 actual && 125 git rev-list refs/remotes/three/tags/t_ >actual && 126 test_line_count = 3 actual && 127 test $(git rev-parse refs/remotes/three/branches/b_~1) = \ 128 $(git rev-parse refs/remotes/three/trunk) && 129 test $(git rev-parse refs/remotes/three/tags/t_~1) = \ 130 $(git rev-parse refs/remotes/three/branches/b_) && 131 git log --pretty=oneline refs/remotes/three/tags/t_ >actual && 132 cut -d" " -f2- actual >output.three && 133 test_cmp expect.three output.three 134 ' 135 136 test_expect_success 'prepare test disallow prefixed multi-globs' " 137 cat >expect.four <>tags/t_end/src/b/readme && 154 poke tags/t_end/src/b/readme && 155 svn_cmd commit -m "try to try" 156 ) && 157 test_must_fail git svn fetch four 2>stderr.four && 158 test_cmp expect.four stderr.four && 159 git config --unset svn-remote.four.branches && 160 git config --unset svn-remote.four.tags 161 ' 162 163 test_expect_success 'prepare test globbing in the middle of the word' ' 164 cat >expect.five <>branches/abcde/src/a/readme && 183 poke branches/b_/src/a/readme && 184 svn_cmd commit -m "Branch commit to abcde" && 185 svn_cmd up && 186 svn_cmd cp branches/abcde tags/fghij && 187 echo "Tag commit to fghij" >>tags/fghij/src/a/readme && 188 poke tags/fghij/src/a/readme && 189 svn_cmd commit -m "Tag commit to fghij" && 190 svn_cmd up 191 ) && 192 git svn fetch five && 193 git rev-list refs/remotes/five/branches/abcde >actual && 194 test_line_count = 2 actual && 195 git rev-list refs/remotes/five/tags/fghij >actual && 196 test_line_count = 3 actual && 197 test $(git rev-parse refs/remotes/five/branches/abcde~1) = \ 198 $(git rev-parse refs/remotes/five/trunk) && 199 test $(git rev-parse refs/remotes/five/tags/fghij~1) = \ 200 $(git rev-parse refs/remotes/five/branches/abcde) && 201 git log --pretty=oneline refs/remotes/five/tags/fghij >actual && 202 cut -d" " -f2- actual >output.five && 203 test_cmp expect.five output.five 204 ' 205 206 test_expect_success 'prepare test disallow multiple asterisks in one word' " 207 echo \"Only one '*' is allowed in a pattern: 'a*c*e'\" >expect.six && 208 echo \"\" >>expect.six 209 " 210 211 test_expect_success 'test disallow multiple asterisks in one word' ' 212 git config --add svn-remote.six.url "$svnrepo" && 213 git config --add svn-remote.six.fetch \ 214 trunk:refs/remotes/six/trunk && 215 git config --add svn-remote.six.branches \ 216 "branches/a*c*e:refs/remotes/six/branches/*" && 217 git config --add svn-remote.six.tags \ 218 "tags/f*h*j:refs/remotes/six/tags/*" && 219 ( 220 cd tmp && 221 echo "try try" >>tags/fghij/src/b/readme && 222 poke tags/fghij/src/b/readme && 223 svn_cmd commit -m "try to try" 224 ) && 225 test_must_fail git svn fetch six 2>stderr.six && 226 test_cmp expect.six stderr.six 227 ' 228 229 test_done