(c *C)
| 153 | } |
| 154 | |
| 155 | func (s *RefSpecSuite) TestRefSpecDstBlob(c *C) { |
| 156 | ref := "refs/heads/abc" |
| 157 | tests := map[string]string{ |
| 158 | "refs/heads/*:refs/remotes/origin/*": "refs/remotes/origin/abc", |
| 159 | "refs/heads/*bc:refs/remotes/origin/*": "refs/remotes/origin/a", |
| 160 | "refs/heads/*bc:refs/remotes/origin/*bc": "refs/remotes/origin/abc", |
| 161 | "refs/heads/a*c:refs/remotes/origin/*": "refs/remotes/origin/b", |
| 162 | "refs/heads/a*c:refs/remotes/origin/a*c": "refs/remotes/origin/abc", |
| 163 | "refs/heads/ab*:refs/remotes/origin/*": "refs/remotes/origin/c", |
| 164 | "refs/heads/ab*:refs/remotes/origin/ab*": "refs/remotes/origin/abc", |
| 165 | "refs/heads/*abc:refs/remotes/origin/*abc": "refs/remotes/origin/abc", |
| 166 | "refs/heads/abc*:refs/remotes/origin/abc*": "refs/remotes/origin/abc", |
| 167 | // for these two cases, git specifically logs: |
| 168 | // error: * Ignoring funny ref 'refs/remotes/origin/' locally |
| 169 | // and ignores the ref; go-git does not currently do this validation, |
| 170 | // but probably should. |
| 171 | // "refs/heads/*abc:refs/remotes/origin/*": "", |
| 172 | // "refs/heads/abc*:refs/remotes/origin/*": "", |
| 173 | } |
| 174 | |
| 175 | for specStr, dst := range tests { |
| 176 | spec := RefSpec(specStr) |
| 177 | c.Assert(spec.Dst(plumbing.ReferenceName(ref)).String(), |
| 178 | Equals, |
| 179 | dst, |
| 180 | Commentf("while getting dst from spec %q with ref %q", specStr, ref), |
| 181 | ) |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | func (s *RefSpecSuite) TestRefSpecReverse(c *C) { |
| 186 | spec := RefSpec("refs/heads/*:refs/remotes/origin/*") |
nothing calls this directly
no test coverage detected