Class: Command::Add

Inherits:
Base
  • Object
show all
Defined in:
lib/command/add.rb

Constant Summary collapse

LOCKED_INDEX_MESSAGE =
"Another jit process seems to be running in this repository.\nPlease make sure all processes are terminated then try again.\nIf it still fails, a jit process may have crashed in this\nrepository earlier: remove the file manually to continue.\n"

Instance Attribute Summary

Attributes inherited from Base

#status

Instance Method Summary collapse

Methods inherited from Base

#execute, #initialize

Constructor Details

This class inherits a constructor from Command::Base

Instance Method Details

#runObject



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/command/add.rb', line 14

def run
  repo.index.load_for_update
  expanded_paths.each { |path| add_to_index(path) }
  repo.index.write_updates
  exit 0
rescue Lockfile::LockDenied => error
  handle_locked_index(error)
rescue Workspace::MissingFile => error
  handle_missing_file(error)
rescue Workspace::NoPermission => error
  handle_unreadable_file(error)
end