Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/shipit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ module Shipit
:internal_hook_receivers,
:preferred_org_emails,
:task_execution_strategy,
:task_logger
:task_logger,
:use_git_askpass
)

def task_execution_strategy
Expand Down Expand Up @@ -297,6 +298,10 @@ def task_logger
@task_logger ||= Logger.new(nil)
end

def use_git_askpass?
@use_git_askpass.nil? ? true : @use_git_askpass
end

protected

def revision_file
Expand Down
2 changes: 1 addition & 1 deletion lib/shipit/commands.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def base_env
'GITHUB_TOKEN' => github.token
)

unless Rails.env.development? || Rails.env.test?
if Shipit.use_git_askpass?
env['GIT_ASKPASS'] = Shipit::Engine.root.join('lib', 'snippets', 'git-askpass').realpath.to_s
end

Expand Down
3 changes: 3 additions & 0 deletions test/dummy/config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
# Raises helpful error messages.
config.assets.raise_runtime_errors = true

# Disable git askpass in development
Shipit.use_git_askpass = false

# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
if Rails.application.config_for(:database)&.dig('adapter') == 'sqlite3'
Expand Down
3 changes: 3 additions & 0 deletions test/dummy/config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,7 @@

# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false

# Make sure git askpass is enabled in production
Shipit.use_git_askpass = true
end
3 changes: 3 additions & 0 deletions test/dummy/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr

# Disable git askpass in test
Shipit.use_git_askpass = false

# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true

Expand Down