[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 226cafd: Tweak ediff-ptch test in previous commit a
From: |
Tino Calancha |
Subject: |
[Emacs-diffs] master 226cafd: Tweak ediff-ptch test in previous commit a bit more |
Date: |
Fri, 31 Mar 2017 23:30:18 -0400 (EDT) |
branch: master
commit 226cafd24df9c233f6359c93273d4da22db7f62d
Author: Tino Calancha <address@hidden>
Commit: Tino Calancha <address@hidden>
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.
---
test/lisp/vc/ediff-ptch-tests.el | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/test/lisp/vc/ediff-ptch-tests.el b/test/lisp/vc/ediff-ptch-tests.el
index aecfe30..7372a72 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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 226cafd: Tweak ediff-ptch test in previous commit a bit more,
Tino Calancha <=