Module: Gity::Operation::RemoveStaged
Instance Method Summary collapse
Methods included from Common
#_cls, #_fmt, #_logger, #_pastel, #_prmt, #print_header
Instance Method Details
#remove_staged(ws, files) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/gity/operation/remove_staged.rb', line 8 def remove_staged(ws, files) _cls print_header _prmt.puts print_workspace_items(ws, files, skip_other_files: true) _prmt.puts efiles = files.staged[:files] + files.staged[:dirs] sels = _prmt.multi_select(_fmt("Please select all files to be removed from staging : "), filter: true, per_page: 10) do |m| efiles.sort.each do |f| m.choice f,f.path end end st, res = ws.remove_from_staging(*sels) raise OperationError, "Remove from staging failed with error : #{res}" if not st end |