sonic-pi
https://github.com/sonic-pi-net/sonic-pi
C++
Code. Music. Live.
Rugged::Repository#status
Returns the status for one or more files in the working directory
of the repository. This is equivalent to the +git status+ command.
The returned +status_data+ is always an array containing one or more
status flags as Ruby symbols. Possible flags are:
- +:index_new+: the file is new in the index
- +:index_modified+: the file has been modified in the index
- +:index_deleted+: the file has been deleted from the index
- +:worktree_new+: the file is new in the working directory
- +:worktree_modified+: the file has been modified in the working directory
- +:worktree_deleted+: the file has been deleted from the working directory
If a +block+ is given, status information will be gathered for every
single file on the working dir. The +block+ will be called with the
status data for each file.
repo.status { |file, status_data| puts "#{file} has status: #{status_data.inspect}" }
results in, for example:
src/diff.c has status: [:index_new, :worktree_new]
README has status: [:worktree_modified]
If a +path+ is given instead, the function will return the +status_data+ for
the file pointed to by path, or raise an exception if the path doesn't exist.
+path+ must be relative to the repository's working directory.
repo.status('src/diff.c') #=> [:index_new, :worktree_new]Edit
git clone [email protected]:sonic-pi-net/sonic-pi.git
cd sonic-pi
open app/server/ruby/vendor/rugged-1.7.1/lib/rugged/repository.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Rugged--Repository-status-for-pr
# Commit to gitgit add app/server/ruby/vendor/rugged-1.7.1/lib/rugged/repository.rbgit commit -m "better docs for Rugged::Repository#status"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Rugged--Repository-status-for-pr
hub pull-request
# Celebrate!