# HG changeset patch # User Matthias Zilk # Date 2015-05-22 23:56:50 # Node ID c44885d0e546303772771141418c5c7d91e0180c # Parent 442d81c381dcfac9181960fd46da1b89efa32245 vcs: added proper windows quoting to git commands (Issue #135) Git repositories could not be forked on windows. diff --git a/kallithea/lib/vcs/backends/git/repository.py b/kallithea/lib/vcs/backends/git/repository.py --- a/kallithea/lib/vcs/backends/git/repository.py +++ b/kallithea/lib/vcs/backends/git/repository.py @@ -17,12 +17,18 @@ import urllib2 import logging import posixpath import string -try: - # Python <=2.7 - from pipes import quote -except ImportError: - # Python 3.3+ - from shlex import quote +import sys +if sys.platform == "win32": + from subprocess import list2cmdline + def quote(s): + return list2cmdline([s]) +else: + try: + # Python <=2.7 + from pipes import quote + except ImportError: + # Python 3.3+ + from shlex import quote from dulwich.objects import Tag from dulwich.repo import Repo, NotGitRepository