remote-hg: add 'insecure' option
If set to true acts as hg's clone/pull --insecure option. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Simon Ruderich committed
Apr 11, 2013 at 07:23 UTC
2e8e813232d33bb7454cc56edb4b5336b7c89ccd
1 file changed
+9
contrib/remote-helpers/git-remote-hg
+9
@@ -30,6 +30,9 @@ import urllib
30
# If you don't want to force pushes (and thus risk creating new remote heads):
31
# git config --global remote-hg.force-push false
32
#
33
+# If you want the equivalent of hg's clone/pull--insecure option:
34
+# git config remote-hg.insecure true
35
+#
36
# git:
37
# Sensible defaults for git.
38
# hg bookmarks are exported as git branches, hg branches are prefixed
@@ -279,6 +282,12 @@ def get_repo(url, alias):
282
myui.setconfig('ui', 'interactive', 'off')
283
myui.fout = sys.stderr
284
285
+ try:
286
+ if get_config('remote-hg.insecure') == 'true\n':
287
+ myui.setconfig('web', 'cacerts', '')
288
+ except subprocess.CalledProcessError:
289
+ pass
290
+
291
if hg.islocal(url):
292
repo = hg.repository(myui, url)
293
else: