diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-10 02:44:10 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-10 02:44:10 -0500 |
| commit | 5a46d415df75b8b0168e2cf48b30fe463c01a77c (patch) | |
| tree | 72c1f8d75b2fb4a020a46f4d3b97778ca65fb331 /tests/test-reconcile--pull-clean.el | |
| parent | 2afb005af6272b1b4229b377db0423dca045732f (diff) | |
| download | dotemacs-5a46d415df75b8b0168e2cf48b30fe463c01a77c.tar.gz dotemacs-5a46d415df75b8b0168e2cf48b30fe463c01a77c.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.el | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/tests/test-reconcile--pull-clean.el b/tests/test-reconcile--pull-clean.el index a10c6f1e..89739987 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) |
