Method: Git::Lib#initialize

Defined in:
lib/git/lib.rb

#initialize(base, logger) ⇒ Lib #initialize(base, logger) ⇒ Lib

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

Create a new Git::Lib object

Overloads:

  • #initialize(base, logger) ⇒ Lib

    Parameters:

    • base (Hash)

      the hash containing paths to the Git working copy, the Git repository directory, and the Git index file.

    • logger (Logger)

    Options Hash (base):

    • :working_directory (Pathname)
    • :repository (Pathname)
    • :index (Pathname)
  • #initialize(base, logger) ⇒ Lib

    Parameters:

    • base (#dir, #repo, #index)

      an object with methods to get the Git worktree (#dir), the Git repository directory (#repo), and the Git index file (#index).

    • logger (Logger)


66
67
68
69
70
71
72
73
74
75
76
# File 'lib/git/lib.rb', line 66

def initialize(base = nil, logger = nil)
  @logger = logger || Logger.new(nil)
  @git_ssh = :use_global_config

  case base
  when Git::Base
    initialize_from_base(base)
  when Hash
    initialize_from_hash(base)
  end
end