diff options
author | Tino Calancha <tino.calancha@gmail.com> | 2017-04-01 12:28:54 +0900 |
---|---|---|
committer | Tino Calancha <tino.calancha@gmail.com> | 2017-04-01 12:28:54 +0900 |
commit | 226cafd24df9c233f6359c93273d4da22db7f62d (patch) | |
tree | 3e383f84644ad45f4a5f2eb0a27a63bfbbe11121 /test | |
parent | d23287a94913a3cc930a6d64eb8c7a101b98d8fd (diff) | |
download | emacs-226cafd24df9c233f6359c93273d4da22db7f62d.tar.gz |
Tweak ediff-ptch test in previous commit a bit more
* test/lisp/vc/ediff-ptch-tests.el (ediff-ptch-test-bug26084):
Apply patches without requiring a shell. Add some comments.
Diffstat (limited to 'test')
-rw-r--r-- | test/lisp/vc/ediff-ptch-tests.el | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/test/lisp/vc/ediff-ptch-tests.el b/test/lisp/vc/ediff-ptch-tests.el index aecfe30d947..7372a72021a 100644 --- a/test/lisp/vc/ediff-ptch-tests.el +++ b/test/lisp/vc/ediff-ptch-tests.el @@ -47,22 +47,25 @@ index 6a07f80..6e8e947 100644 (default-directory (file-name-as-directory tmpdir)) (patch (make-temp-file "ediff-ptch-test")) (qux (expand-file-name "qux.txt" tmpdir)) - (bar (expand-file-name "bar.txt" tmpdir))) + (bar (expand-file-name "bar.txt" tmpdir)) + (git-program (executable-find "git"))) + ;; Create repository. (with-temp-buffer (insert "qux here\n") (write-region nil nil qux nil 'silent) (erase-buffer) (insert "bar here\n") (write-region nil nil bar nil 'silent)) - (call-process "git" nil nil nil "init") - (call-process "git" nil nil nil "add" ".") - (call-process "git" nil nil nil "commit" "-m" "Test repository.") + (call-process git-program nil nil nil "init") + (call-process git-program nil nil nil "add" ".") + (call-process git-program nil nil nil "commit" "-m" "Test repository.") + ;; Update repo., save the diff and reset to initial state. (with-temp-buffer (insert "foo here\n") (write-region nil nil qux nil 'silent) (write-region nil nil bar nil 'silent)) - (call-process "git" nil `(:file ,patch) nil "diff") - (call-process "git" nil nil nil "reset" "--hard" "HEAD") + (call-process git-program nil `(:file ,patch) nil "diff") + (call-process git-program nil nil nil "reset" "--hard" "HEAD") (find-file patch) (unwind-protect (let* ((info @@ -79,13 +82,12 @@ index 6a07f80..6e8e947 100644 (dolist (x (list (cons patch1 bar) (cons patch2 qux))) (with-temp-buffer (insert (car x)) - (call-shell-region (point-min) - (point-max) - (format "%s %s %s %s" - ediff-patch-program - ediff-patch-options - ediff-backup-specs - (cdr x))))) + (call-process-region (point-min) + (point-max) + ediff-patch-program + nil nil nil + "-f" "-z.orig" "-b" + (cdr x)))) ;; Check backup files were saved correctly. (dolist (x (list qux bar)) (should-not (string= (with-temp-buffer |