Class: RubyGit::Status::UntrackedEntry
- Defined in:
- lib/ruby_git/status/untracked_entry.rb
Overview
Represents an untracked file in git status
Constant Summary
Constants inherited from Entry
Entry::RENAME_OPERATIONS, Entry::STATUS_CODES
Instance Attribute Summary
Attributes inherited from Entry
Class Method Summary collapse
-
.parse(line) ⇒ RubyGit::Status::UntrackedEntry
Parse a git status line to create an untracked entry.
Instance Method Summary collapse
-
#initialize(path:) ⇒ UntrackedEntry
constructor
Initialize with the path.
-
#unstaged? ⇒ Boolean
Does the entry have unstaged changes in the worktree?.
-
#untracked? ⇒ Boolean
Is the entry an untracked file?.
Methods inherited from Entry
#fully_staged?, #ignored?, #index_status, rename_operation_to_symbol, #staged?, status_to_symbol, #unmerged?, #worktree_status
Constructor Details
#initialize(path:) ⇒ UntrackedEntry
Initialize with the path
31 32 33 |
# File 'lib/ruby_git/status/untracked_entry.rb', line 31 def initialize(path:) super(path) end |
Class Method Details
.parse(line) ⇒ RubyGit::Status::UntrackedEntry
Parse a git status line to create an untracked entry
19 20 21 22 |
# File 'lib/ruby_git/status/untracked_entry.rb', line 19 def self.parse(line) tokens = line.split(' ', 2) new(path: tokens[1]) end |
Instance Method Details
#unstaged? ⇒ Boolean
Does the entry have unstaged changes in the worktree?
- An entry can have both staged and unstaged changes
- All untracked entries are considered unstaged
49 |
# File 'lib/ruby_git/status/untracked_entry.rb', line 49 def unstaged? = true |
#untracked? ⇒ Boolean
Is the entry an untracked file?
39 |
# File 'lib/ruby_git/status/untracked_entry.rb', line 39 def untracked? = true |