sonic-pi
https://github.com/sonic-pi-net/sonic-pi
C++
Code. Music. Live.
Rugged::Remote#check_connection
Try to connect to the +remote+. Useful to simulate
<tt>git fetch --dry-run</tt> and <tt>git push --dry-run</tt>.
Returns +true+ if connection is successful, +false+ otherwise.
+direction+ must be either +:fetch+ or +:push+.
The following options can be passed in the +options+ Hash:
+credentials+ ::
The credentials to use for the connection. 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)
Example:
remote = repo.remotes["origin"]
success = remote.check_connection(:fetch)
raise Error("Unable to pull without credentials") unless successEdit
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 branchgit checkout -b -your-name--update-docs-Rugged--Remote-check_connection-for-pr
# Commit to gitgit add app/server/ruby/vendor/rugged-1.7.1/ext/rugged/rugged_remote.cgit commit -m "better docs for Rugged::Remote#check_connection"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Rugged--Remote-check_connection-for-pr
hub pull-request
# Celebrate!