Class: Repository::HardReset

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

Instance Method Summary collapse

Constructor Details

#initialize(repo, oid) ⇒ HardReset

Returns a new instance of HardReset.



6
7
8
9
# File 'lib/repository/hard_reset.rb', line 6

def initialize(repo, oid)
  @repo = repo
  @oid  = oid
end

Instance Method Details

#executeObject



11
12
13
14
15
16
# File 'lib/repository/hard_reset.rb', line 11

def execute
  @status = @repo.status(@oid)
  changed = @status.changed.map { |path| Pathname.new(path) }

  changed.each { |path| reset_path(path) }
end