fetch method

TransferProgress fetch({
  1. List<String> refspecs = const [],
  2. String? reflogMessage,
  3. GitFetchPrune prune = GitFetchPrune.unspecified,
  4. String? proxy,
  5. Callbacks callbacks = const Callbacks(),
})

Downloads new data and updates tips.

This method connects to the remote repository, downloads any new data, and updates the local repository's remote-tracking branches.

refspecs is the list of refspecs to use for this fetch. Defaults to the base refspecs.

reflogMessage is the message to insert into the reflogs. Default is "fetch".

prune determines whether to perform a prune after the fetch.

proxy can be 'auto' to try to auto-detect the proxy from the git configuration or some specified url. By default connection isn't done through proxy.

callbacks is the combination of callback functions from Callbacks object.

Throws a LibGit2Error if error occurred.

Implementation

TransferProgress fetch({
  List<String> refspecs = const [],
  String? reflogMessage,
  GitFetchPrune prune = GitFetchPrune.unspecified,
  String? proxy,
  Callbacks callbacks = const Callbacks(),
}) {
  remote_bindings.fetch(
    remotePointer: _remotePointer,
    refspecs: refspecs,
    prune: prune.value,
    callbacks: callbacks,
    reflogMessage: reflogMessage,
    proxyOption: proxy,
  );
  return TransferProgress(remote_bindings.stats(_remotePointer));
}