]> git.eshelyaron.com Git - emacs.git/commitdiff
Use "~1" instead of "^" in vc-git.el to specify the parent of a Git commit.
authorEli Zaretskii <eliz@gnu.org>
Fri, 21 Nov 2014 10:34:59 +0000 (12:34 +0200)
committerEli Zaretskii <eliz@gnu.org>
Fri, 21 Nov 2014 10:34:59 +0000 (12:34 +0200)
 lisp/vc/vc-git.el (vc-git-previous-revision): Use "~1" instead of
 "^", since the latter is a special character for MS-Windows system
 shells.

lisp/ChangeLog
lisp/vc/vc-git.el

index 13bc0ba5db2fe4e770e1a0b3f21b82ff34500930..1ce22d0fdbd1188d58c5800243ec03cb796e8331 100644 (file)
@@ -3,6 +3,8 @@
        * vc/vc-git.el (vc-git-command, vc-git--call): Bind
        coding-system-for-read and coding-system-for-write to
        vc-git-commits-coding-system.
+       (vc-git-previous-revision): Use "~1" instead of "^", since the
+       latter is a special character for MS-Windows system shells.
 
 2014-11-20  Michael Albinus  <michael.albinus@gmx.de>
 
index 0ff5ba2c39dbd032e2ecc42db76aea2a4a0c109b..ae6b13a6c6097d4b0451e9fd513548cc6b1096fd 100644 (file)
@@ -987,7 +987,11 @@ or BRANCH^ (where \"^\" can be repeated)."
                            (point)
                            (1- (point-max)))))))
         (or (vc-git-symbolic-commit prev-rev) prev-rev))
-    (vc-git--rev-parse (concat rev "^"))))
+    ;; We used to use "^" here, but that fails on MS-Windows if git is
+    ;; invoked via a batch file, in which case cmd.exe strips the "^"
+    ;; because it is a special character for cmd which process-file
+    ;; does not (and cannot) quote.
+    (vc-git--rev-parse (concat rev "~1"))))
 
 (defun vc-git--rev-parse (rev)
   (with-temp-buffer