Class: Git::Commands::Maintenance::Start Private

Inherits:
Base
  • Object
show all
Defined in:
lib/git/commands/maintenance/start.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Note:

arguments block audited against https://git-scm.com/docs/git-maintenance/2.54.0

Initialize and start background maintenance on the current repository

Examples:

Start background maintenance with default scheduler

Git::Commands::Maintenance::Start.new(execution_context).call

Start with a specific scheduler

Git::Commands::Maintenance::Start.new(execution_context).call(scheduler: 'crontab')

See Also:

Instance Method Summary collapse

Methods inherited from Base

allow_exit_status, arguments, #initialize, requires_git_version, skip_version_validation

Constructor Details

This class inherits a constructor from Git::Commands::Base

Instance Method Details

#call(**options) ⇒ Git::CommandLineResult

Initialize config values and start background maintenance

This performs the same config updates as register, then updates the background scheduler to run git maintenance run --scheduled on an hourly basis.

Parameters:

  • options (Hash)

    command options

Options Hash (**options):

  • :scheduler (String) — default: nil

    specify the scheduler to use

    Must be one of 'auto', 'crontab', 'systemd-timer', 'launchctl', or 'schtasks'. When 'auto', the appropriate platform-specific scheduler is used. Default is 'auto'.

  • :env (Hash) — default: nil

    environment variables to set for the git process; merged with the default environment; not passed to the git CLI

Returns:

Raises:

  • (ArgumentError)

    if unsupported options are provided

  • (Git::FailedError)

    if git exits with a non-zero exit status

  • (Git::VersionError)

    if git version is below 2.30.0



# File 'lib/git/commands/maintenance/start.rb', line 35