Sha256: cf41d5fc9f2e358f82bb04b7a438a779336b062d818d17f7cb20e7e97fb6653c

Contents?: true

Size: 631 Bytes

Versions: 17

Compression:

Stored size: 631 Bytes

Contents

# frozen_string_literal: true

# takelage git check main
module GitCheckMain
  # Backend method for git check main.
  # @return [Boolean] are we on the git main branch?
  def git_check_main
    log.debug 'Check if we are on the git main branch'

    return false unless git_check_workspace

    branch = _git_check_main_get_branch
    log.debug "We are on git branch \"#{branch}\""

    branch == config.active['git_main_branch']
  end

  private

  # Get git branch.
  def _git_check_main_get_branch
    cmd_get_branch =
      config.active['cmd_git_check_main_git_branch']
    (run cmd_get_branch).chomp.split('/')[-1]
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
takelage-0.29.14 lib/takelage/git/check/main.rb
takelage-0.29.13 lib/takelage/git/check/main.rb
takelage-0.29.11 lib/takelage/git/check/main.rb
takelage-0.29.10 lib/takelage/git/check/main.rb
takelage-0.29.8 lib/takelage/git/check/main.rb
takelage-0.29.6 lib/takelage/git/check/main.rb
takelage-0.29.0 lib/takelage/git/check/main.rb
takelage-0.28.26 lib/takelage/git/check/main.rb
takelage-0.28.24 lib/takelage/git/check/main.rb
takelage-0.28.14 lib/takelage/git/check/main.rb
takelage-0.28.11 lib/takelage/git/check/main.rb
takelage-0.28.8 lib/takelage/git/check/main.rb
takelage-0.28.7 lib/takelage/git/check/main.rb
takelage-0.28.5 lib/takelage/git/check/main.rb
takelage-0.27.1 lib/takelage/git/check/main.rb
takelage-0.27.0 lib/takelage/git/check/main.rb
takelage-0.26.7 lib/takelage/git/check/main.rb