]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/chef/libraries/git.rb
Monkey patch git provider to add --force when fetching tags
[chef.git] / cookbooks / chef / libraries / git.rb
diff --git a/cookbooks/chef/libraries/git.rb b/cookbooks/chef/libraries/git.rb
new file mode 100644 (file)
index 0000000..ae797fc
--- /dev/null
@@ -0,0 +1,13 @@
+module OpenStreetMap
+  module Provider
+    module Git
+      def git(*args, **run_opts)
+        args.push("--force") if args.first == "fetch" && args.last == "--tags"
+
+        super(args, run_opts)
+      end
+    end
+  end
+end
+
+Chef::Provider::Git.prepend(OpenStreetMap::Provider::Git)