aboutsummaryrefslogtreecommitdiff
path: root/tests/test-reconcile--pull-clean.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-10 02:44:10 -0500
committerCraig Jennings <c@cjennings.net>2026-05-10 02:44:10 -0500
commit6bacfea0bc34e11cee9f90e17d7fb2840bed2880 (patch)
tree72c1f8d75b2fb4a020a46f4d3b97778ca65fb331 /tests/test-reconcile--pull-clean.el
parent1e33ee472ec9b6a14e7b313bd85b89ffa35a4a5f (diff)
downloaddotemacs-6bacfea0bc34e11cee9f90e17d7fb2840bed2880.tar.gz
dotemacs-6bacfea0bc34e11cee9f90e17d7fb2840bed2880.zip
Make repo reconciliation review-first
Stop automatically stashing, pulling, and popping dirty repos during reconciliation. Clean repos still pull, dirty repos open Magit for review, and results now include structured statuses, skip reasons, pruning, and a summary.
Diffstat (limited to 'tests/test-reconcile--pull-clean.el')
-rw-r--r--tests/test-reconcile--pull-clean.el32
1 files changed, 17 insertions, 15 deletions
diff --git a/tests/test-reconcile--pull-clean.el b/tests/test-reconcile--pull-clean.el
index a10c6f1e4..89739987e 100644
--- a/tests/test-reconcile--pull-clean.el
+++ b/tests/test-reconcile--pull-clean.el
@@ -17,12 +17,14 @@
("repo/.git/")
(let ((dir (expand-file-name "repo" test-root))
(messages nil))
- (reconcile-test-with-shell-mocks
- (lambda (_cmd) 0)
- (lambda (_cmd) "")
- (cl-letf (((symbol-function 'message)
+ (reconcile-test-with-git-mock
+ (lambda (args)
+ (should (equal args '("pull" "--rebase" "--quiet")))
+ '(:exit 0 :output ""))
+ (cl-letf (((symbol-function 'message)
(lambda (fmt &rest args) (push (apply #'format fmt args) messages))))
- (cj/reconcile--pull-clean dir)))
+ (let ((result (cj/reconcile--pull-clean dir)))
+ (should (eq (plist-get result :status) 'pulled)))))
(should-not (cl-some (lambda (m) (string-match-p "Warning" m)) messages)))))
(ert-deftest test-pull-clean-normal-failure-warns ()
@@ -31,12 +33,13 @@
("repo/.git/")
(let ((dir (expand-file-name "repo" test-root))
(messages nil))
- (reconcile-test-with-shell-mocks
- (lambda (_cmd) 1)
- (lambda (_cmd) "")
- (cl-letf (((symbol-function 'message)
+ (reconcile-test-with-git-mock
+ (lambda (_args) '(:exit 1 :output "boom\n"))
+ (cl-letf (((symbol-function 'message)
(lambda (fmt &rest args) (push (apply #'format fmt args) messages))))
- (cj/reconcile--pull-clean dir)))
+ (let ((result (cj/reconcile--pull-clean dir)))
+ (should (eq (plist-get result :status) 'pull-failed))
+ (should (equal (plist-get result :output) "boom\n")))))
(should (cl-some (lambda (m) (string-match-p "Warning.*git pull failed" m)) messages))
(should (cl-some (lambda (m) (string-match-p "exit code: 1" m)) messages)))))
@@ -48,12 +51,11 @@
("repo/.git/")
(let ((dir (expand-file-name "repo" test-root))
(messages nil))
- (reconcile-test-with-shell-mocks
- (lambda (_cmd) 128)
- (lambda (_cmd) "")
- (cl-letf (((symbol-function 'message)
+ (reconcile-test-with-git-mock
+ (lambda (_args) '(:exit 128 :output "fatal\n"))
+ (cl-letf (((symbol-function 'message)
(lambda (fmt &rest args) (push (apply #'format fmt args) messages))))
- (cj/reconcile--pull-clean dir)))
+ (cj/reconcile--pull-clean dir)))
(should (cl-some (lambda (m) (string-match-p "exit code: 128" m)) messages)))))
(provide 'test-reconcile--pull-clean)