Method: Git::Diff#path
- Defined in:
- lib/git/diff.rb
#path(*paths) ⇒ self
Limits the diff to the specified path(s)
When called with no arguments (or only nil arguments), removes any existing path filter, showing all files in the diff. Internally stores a single path as a String and multiple paths as an Array for efficiency.
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/git/diff.rb', line 40 def path(*paths) validate_paths_not_arrays(paths) cleaned_paths = paths.compact @path = if cleaned_paths.empty? nil elsif cleaned_paths.length == 1 cleaned_paths.first else cleaned_paths end self end |