Class: Repository::Status

Inherits:
Object
  • Object
show all
Defined in:
lib/repository/status.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repository, commit_oid = nil) ⇒ Status

Returns a new instance of Status.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/repository/status.rb', line 17

def initialize(repository, commit_oid = nil)
  @repo  = repository
  @stats = {}

  @inspector = Inspector.new(@repo)

  @changed           = SortedSet.new
  @index_changes     = SortedHash.new
  @conflicts         = SortedHash.new
  @workspace_changes = SortedHash.new
  @untracked_files   = SortedSet.new

  commit_oid ||= @repo.refs.read_head
  @head_tree   = @repo.database.load_tree_list(commit_oid)

  scan_workspace
  check_index_entries
  collect_deleted_head_files
end

Instance Attribute Details

#changedObject (readonly)

Returns the value of attribute changed.



9
10
11
# File 'lib/repository/status.rb', line 9

def changed
  @changed
end

#conflictsObject (readonly)

Returns the value of attribute conflicts.



9
10
11
# File 'lib/repository/status.rb', line 9

def conflicts
  @conflicts
end

#head_treeObject (readonly)

Returns the value of attribute head_tree.



9
10
11
# File 'lib/repository/status.rb', line 9

def head_tree
  @head_tree
end

#index_changesObject (readonly)

Returns the value of attribute index_changes.



9
10
11
# File 'lib/repository/status.rb', line 9

def index_changes
  @index_changes
end

#statsObject (readonly)

Returns the value of attribute stats.



9
10
11
# File 'lib/repository/status.rb', line 9

def stats
  @stats
end

#untracked_filesObject (readonly)

Returns the value of attribute untracked_files.



9
10
11
# File 'lib/repository/status.rb', line 9

def untracked_files
  @untracked_files
end

#workspace_changesObject (readonly)

Returns the value of attribute workspace_changes.



9
10
11
# File 'lib/repository/status.rb', line 9

def workspace_changes
  @workspace_changes
end