]> git.openstreetmap.org Git - chef.git/commitdiff
Monkey patch git provider to add --force when fetching tags
authorTom Hughes <tom@compton.nu>
Tue, 5 May 2020 17:40:36 +0000 (18:40 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 5 May 2020 17:43:24 +0000 (18:43 +0100)
cookbooks/chef/libraries/git.rb [new file with mode: 0644]

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)