Module: GitWit::Commands::GitShell

Included in:
GitWit::Cli
Defined in:
lib/git_wit/commands/git_shell.rb

Constant Summary collapse

GIT_SHELL_COMMAND_RE =
/^(git-[^\s]+)\s+'([^']+\.git)'/
GIT_SHELL_COMMANDS =
%w(git-upload-pack git-receive-pack git-upload-archive)

Instance Method Summary collapse

Instance Method Details

#git_shell(user, cmd = nil, repo = nil) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/git_wit/commands/git_shell.rb', line 7

def git_shell(user, cmd = nil, repo = nil)
  @command, @repository, @user = cmd, repo, nil
  exec_with_sudo!
  boot_app
  parse_ssh_original_command if ENV["SSH_ORIGINAL_COMMAND"].present?
  validate_git_shell_command
  authenticate user
  authorize
  run_git_shell
end