sonic-pi

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

C++

Code. Music. Live.

Rugged::Repository.hash_file

Hash the contents of the file pointed at by +path+, assuming
that it'd be stored in the ODB with the given +type+, and return
a hex string representing the SHA1 OID resulting from the hash.

  Repository.hash_file('foo.txt', :commit) #=> "de5ba987198bcf2518885f0fc1350e5172cded78"

  Repository.hash_file('foo.txt', :tag) #=> "9d09060c850defbc7711d08b57def0d14e742f4e"

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_repo.c

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Rugged--Repository-hash_file-for-pr


# Commit to git

git add app/server/ruby/vendor/rugged-1.7.1/ext/rugged/rugged_repo.cgit commit -m "better docs for Rugged::Repository.hash_file"


# 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--Repository-hash_file-for-pr

hub pull-request


# Celebrate!