git: rework how to do excludes
authorBrett Lentz <blentz@classmates.com>
Tue, 14 Sep 2010 21:14:45 +0000 (14:14 -0700)
committerBrett Lentz <blentz@classmates.com>
Tue, 14 Sep 2010 21:14:45 +0000 (14:14 -0700)
lib/puppet/provider/vcsrepo/git.rb

index 38c247b..bbcf14c 100644 (file)
@@ -221,11 +221,7 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo)
   end
 
   def set_excludes
-    open(File.join(@resource.value(:path), '.git/info/exclude'), 'w') do |f|
-      @resource.value(:excludes).each do |ex|
-        f.write(ex + "\n")
-      end
-    end
+    at_path { open('.git/info/exclude', 'w') { |f| @resource.value(:excludes).each { |ex| f.write(ex + "\n") }}}
   end
 
   def get_revision(rev)