branch: externals/vc-jj
commit a85e1255b1949c14438c7a5f3ab36e956e5ca6d0
Author: Wojciech Siewierski <wojci...@siewierski.eu>
Commit: Wojciech Siewierski <wojci...@siewierski.eu>

    Provide the expected return values
---
 vc-jj.el | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/vc-jj.el b/vc-jj.el
index 1f8fcaa2ab..1bf15e202f 100644
--- a/vc-jj.el
+++ b/vc-jj.el
@@ -23,6 +23,8 @@
 
 ;;; Code:
 
+(require 'seq)
+
 (autoload 'vc-setup-buffer "vc-dispatcher")
 (autoload 'vc-switches "vc")
 
@@ -71,11 +73,13 @@
   ;; TODO: should be async!
   (let ((files (apply #'process-lines "jj" "file" "list" "--" dir))
         (modified (apply #'process-lines "jj" "diff" "--name-only" "--" dir)))
-    (mapcar (lambda (file)
-              (let ((vc-state (if (member file modified)
-                                  'edited
-                                'up-to-date)))
-                (list file vc-state))))))
+    (let ((result
+           (mapcar (lambda (file)
+                     (let ((vc-state (if (member file modified)
+                                         'edited
+                                       'up-to-date)))
+                       (list file vc-state))))))
+      (funcall update-function result nil))))
 
 (defun vc-jj-working-revision (file)
   (when-let ((root (vc-jj-root file)))
@@ -166,7 +170,10 @@
   (setq rev2 (or rev2 "@"))
   (let ((inhibit-read-only t)
         (args (append (vc-switches 'jj 'diff) (list "--") files)))
-    (apply #'call-process "jj" nil buffer nil "diff" "--from" rev1 "--to" rev2 
args)))
+    (apply #'call-process "jj" nil buffer nil "diff" "--from" rev1 "--to" rev2 
args)
+    (if (seq-some #'vc-jj--file-modified files)
+        1
+      0)))
 
 (defun vc-jj-revision-completion-table (files)
   (let ((revisions

Reply via email to