Class: MGit::Reset

Inherits:
BaseCommand show all
Defined in:
lib/m-git/command/reset.rb

Constant Summary

Constants inherited from BaseCommand

BaseCommand::HIGH_PRIORITY_OPT_LIST, BaseCommand::SELECTABLE_OPT_LIST

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseCommand

#all_repos, cmd, #exec_light_repos, #generate_config_repo, inherited, #initialize, #locked_repos, #run

Constructor Details

This class inherits a constructor from MGit::BaseCommand

Class Method Details

.descriptionObject



21
22
23
# File 'lib/m-git/command/reset.rb', line 21

def self.description
  "将当前HEAD指针还原到指定状态。"
end

.usageObject



25
26
27
# File 'lib/m-git/command/reset.rb', line 25

def self.usage
  "mgit reset [<git-reset-option>] [(--mrepo|--el-mrepo) <repo>...] [--help]"
end

Instance Method Details

#enable_repo_selectionObject



17
18
19
# File 'lib/m-git/command/reset.rb', line 17

def enable_repo_selection
  true
end

#execute(argv) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/m-git/command/reset.rb', line 9

def execute(argv)
  Workspace.check_branch_consistency

  Output.puts_start_cmd
  _, error_repos = Workspace.execute_git_cmd_with_repos(argv.cmd, argv.git_opts, all_repos)
  Output.puts_succeed_cmd(argv.absolute_cmd) if error_repos.length == 0
end