sonic-pi

https://github.com/sonic-pi-net/sonic-pi

C++

Code. Music. Live.

Rugged::Remote#fetch

Downloads new data from the remote for the given +refspecs+ and updates tips.

You can optionally pass in a single or multiple alternative +refspecs+ to use instead of the fetch
refspecs already configured for +remote+.

Returns a hash containing statistics for the fetch operation.

The following options can be passed in the +options+ Hash:

:credentials ::
  The credentials to use for the fetch operation. Can be either an instance of one
  of the Rugged::Credentials types, or a proc returning one of the former.
  The proc will be called with the +url+, the +username+ from the url (if applicable) and
  a list of applicable credential types.

:headers ::
  Extra HTTP headers to include with the request (only applies to http:// or https:// remotes)

:progress ::
  A callback that will be executed with the textual progress received from the remote.
  This is the text send over the progress side-band (ie. the "counting objects" output).

:transfer_progress ::
  A callback that will be executed to report clone progress information. It will be passed
  the amount of +total_objects+, +indexed_objects+, +received_objects+, +local_objects+,
  +total_deltas+, +indexed_deltas+ and +received_bytes+.

:update_tips ::
  A callback that will be executed each time a reference is updated locally. It will be
  passed the +refname+, +old_oid+ and +new_oid+.

:message ::
  The message to insert into the reflogs. Defaults to "fetch".

:prune ::
  Specifies the prune mode for the fetch. +true+ remove any remote-tracking references that
  no longer exist, +false+ do not prune, +nil+ use configured settings Defaults to "nil".

Example:

  remote = Rugged::Remote.lookup(@repo, 'origin')
  remote.fetch({
    transfer_progress: lambda { |total_objects, indexed_objects, received_objects, local_objects, total_deltas, indexed_deltas, received_bytes|
      # ...
    }
  })

Source | Google | Stack overflow

Edit

git clone [email protected]:sonic-pi-net/sonic-pi.git

cd sonic-pi

open app/server/ruby/vendor/rugged-1.7.1/ext/rugged/rugged_remote.c

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Rugged--Remote-fetch-for-pr


# Commit to git

git add app/server/ruby/vendor/rugged-1.7.1/ext/rugged/rugged_remote.cgit commit -m "better docs for Rugged::Remote#fetch"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Rugged--Remote-fetch-for-pr

hub pull-request


# Celebrate!