lib/shipit/commands.rb in shipit-engine-0.34.0 vs lib/shipit/commands.rb in shipit-engine-0.35.0

- old
+ new

@@ -18,22 +18,28 @@ end delegate :git_version, to: :class def env - @env ||= Shipit.env.merge( - 'GITHUB_DOMAIN' => github.domain, - 'GITHUB_TOKEN' => github.token, - 'GIT_ASKPASS' => Shipit::Engine.root.join('lib', 'snippets', 'git-askpass').realpath.to_s, - ) + base_env end def git(*args) - Command.new("git", *args) + kwargs = args.extract_options! + kwargs[:env] ||= base_env + Command.new("git", *args, **kwargs) end ruby2_keywords :git if respond_to?(:ruby2_keywords, true) private + + def base_env + @base_env ||= Shipit.env.merge( + 'GITHUB_DOMAIN' => github.domain, + 'GITHUB_TOKEN' => github.token, + 'GIT_ASKPASS' => Shipit::Engine.root.join('lib', 'snippets', 'git-askpass').realpath.to_s, + ) + end def github Shipit.github end end