Get the list of references with which the server responds to a new connection. Parameters: callbacks : Passed to connect() proxy : Passed to connect() connect : Whether to connect to the remote first. You can pass False if the remote has a
(
self,
callbacks: RemoteCallbacks | None = None,
proxy: str | None | bool = None,
connect: bool = True,
)
| 247 | return TransferProgress(C.git_remote_stats(self._remote)) |
| 248 | |
| 249 | def list_heads( |
| 250 | self, |
| 251 | callbacks: RemoteCallbacks | None = None, |
| 252 | proxy: str | None | bool = None, |
| 253 | connect: bool = True, |
| 254 | ) -> list[RemoteHead]: |
| 255 | """ |
| 256 | Get the list of references with which the server responds to a new |
| 257 | connection. |
| 258 | |
| 259 | Parameters: |
| 260 | |
| 261 | callbacks : Passed to connect() |
| 262 | |
| 263 | proxy : Passed to connect() |
| 264 | |
| 265 | connect : Whether to connect to the remote first. You can pass False |
| 266 | if the remote has already connected. The list remains available after |
| 267 | disconnecting as long as a new connection is not initiated. |
| 268 | """ |
| 269 | |
| 270 | if connect: |
| 271 | self.connect(callbacks=callbacks, proxy=proxy) |
| 272 | |
| 273 | refs_ptr = ffi.new('git_remote_head ***') |
| 274 | size_ptr = ffi.new('size_t *') |
| 275 | |
| 276 | err = C.git_remote_ls(refs_ptr, size_ptr, self._remote) |
| 277 | check_error(err) |
| 278 | |
| 279 | num_refs = int(size_ptr[0]) |
| 280 | results = [RemoteHead(refs_ptr[0][i]) for i in range(num_refs)] |
| 281 | |
| 282 | return results |
| 283 | |
| 284 | def ls_remotes( |
| 285 | self, |