Support Git editor paths with spaces

Git requires single quotes for paths with spaces.
We however need to convert single quotes to double quotes for Windows to treat such paths as a single path.

Bug: 916922
Change-Id: I89b23552a2a32d5aa58ea4f207690595823692d5
Reviewed-on: https://chromium-review.googlesource.com/c/1467301
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Raul Tambre <raul@tambre.ee>
changes/01/1467301/2
Raul Tambre 6 years ago committed by Commit Bot
parent 98a7e80352
commit 5a52587030

@ -908,7 +908,11 @@ class Settings(object):
def GetGitEditor(self):
"""Return the editor specified in the git config, or None if none is."""
if self.git_editor is None:
self.git_editor = self._GetConfig('core.editor', error_ok=True)
# Git requires single quotes for paths with spaces. We need to replace
# them with double quotes for Windows to treat such paths as a single
# path.
self.git_editor = self._GetConfig(
'core.editor', error_ok=True).replace('\'', '"')
return self.git_editor or None
def GetLintRegex(self):

Loading…
Cancel
Save