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>
diff --git a/git_cl.py b/git_cl.py
index 7fe6c30..ba32f71 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -908,7 +908,11 @@
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):