class Rugged::Repository
def status(file = nil, &block)
+path+ must be relative to the repository's working directory.
the file pointed to by path, or raise an exception if the path doesn't exist.
If a +path+ is given instead, the function will return the +status_data+ for
README has status: [:worktree_modified]
src/diff.c has status: [:index_new, :worktree_new]
results in, for example:
repo.status { |file, status_data| puts "#{file} has status: #{status_data.inspect}" }
status data for each file.
single file on the working dir. The +block+ will be called with the
If a +block+ is given, status information will be gathered for every
- +:worktree_deleted+: the file has been deleted from the working directory
- +:worktree_modified+: the file has been modified in the working directory
- +:worktree_new+: the file is new in the working directory
- +:index_deleted+: the file has been deleted from the index
- +:index_modified+: the file has been modified in the index
- +:index_new+: the file is new in the index
status flags as Ruby symbols. Possible flags are:
The returned +status_data+ is always an array containing one or more
of the repository. This is equivalent to the +git status+ command.
Returns the status for one or more files in the working directory
repo.status(path) -> status_data
repo.status { |file, status_data| block }
call-seq:
##
def status(file = nil, &block) if file file_status file else each_status(&block) end end