Skip to content

Commit

Permalink
use a guard clause
Browse files Browse the repository at this point in the history
  • Loading branch information
KoenDierckx committed Aug 11, 2022
1 parent bc10fa1 commit ba2cdda
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/puppet/provider/vcsrepo/git.rb
Original file line number Diff line number Diff line change
Expand Up @@ -642,11 +642,11 @@ def add_safe_directory

# @!visibility private
def remove_safe_directory
if safe_directories.include?(@resource.value(:path))
notice("Removing '#{@resource.value(:path)}' from safe directory list")
args = ['config', '--global', '--unset', 'safe.directory', @resource.value(:path)]
git_with_identity(*args)
end
return if safe_directories.include?(@resource.value(:path))

notice("Removing '#{@resource.value(:path)}' from safe directory list")
args = ['config', '--global', '--unset', 'safe.directory', @resource.value(:path)]
git_with_identity(*args)
end

# @!visibility private
Expand Down

0 comments on commit ba2cdda

Please sign in to comment.