Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
elfranne authored Apr 11, 2024
1 parent 16d4336 commit 474c000
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/puppet/provider/vcsrepo/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -731,15 +731,15 @@ def git_ssh_with_identity_ssh_file(*args)

# Execute git with the given args, running it as the user specified.
def exec_git(*args)
exec_args = {
failonfail: true,
combine: true,
custom_environment: { 'HOME' => Dir.home }
}
if @resource.value(:user) && @resource.value(:user) != Facter['id'].value
exec_args[:custom_environment] = { 'HOME' => Dir.home(@resource.value(:user)) }
exec_args[:uid] = @resource.value(:user)
end
exec_args = {
failonfail: true,
combine: true,
custom_environment: { 'HOME' => Dir.home },
}

if @resource.value(:user) && @resource.value(:user) != Facter['id'].value
exec_args[:custom_environment] = { 'HOME' => Dir.home(@resource.value(:user)) }
exec_args[:uid] = @resource.value(:user)
end
withumask do
Puppet::Util::Execution.execute([:git, args], **exec_args)
Expand Down

0 comments on commit 474c000

Please sign in to comment.