(self, state: GitHubState, refName: str)
| 219 | # TODO: This should take which repository the ref is in |
| 220 | # This only works if you have upstream_sh |
| 221 | def _make_ref(self, state: GitHubState, refName: str) -> "Ref": |
| 222 | # TODO: Probably should preserve object identity here when |
| 223 | # you call this with refName/oid that are the same |
| 224 | assert state.upstream_sh |
| 225 | gitObject = GitObject( |
| 226 | id=state.next_id(), |
| 227 | # TODO: this upstream_sh hardcode wrong, but ok for now |
| 228 | # because we only have one repo |
| 229 | oid=GitObjectID(state.upstream_sh.git("rev-parse", refName)), |
| 230 | _repository=self.id, |
| 231 | ) |
| 232 | ref = Ref( |
| 233 | id=state.next_id(), |
| 234 | name=refName, |
| 235 | _repository=self.id, |
| 236 | target=gitObject, |
| 237 | ) |
| 238 | return ref |
| 239 | |
| 240 | |
| 241 | @dataclass |
no test coverage detected