emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/vc-got db89d6f 114/145: add a wrapper for the update co


From: ELPA Syncer
Subject: [elpa] externals/vc-got db89d6f 114/145: add a wrapper for the update command
Date: Thu, 9 Sep 2021 15:58:45 -0400 (EDT)

branch: externals/vc-got
commit db89d6fde605ba589cb2ed0cac89b3eceae8b4e8
Author: Omar Polo <op@omarpolo.com>
Commit: Omar Polo <op@omarpolo.com>

    add a wrapper for the update command
---
 vc-got.el | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/vc-got.el b/vc-got.el
index 54ff57f..65e4b0f 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -352,6 +352,16 @@ given COMMIT."
   (with-temp-buffer
     (zerop (vc-got--call "integrate" branch))))
 
+(defun vc-got--update (branch &optional paths)
+  "Update to a different commit or BRANCH.
+Optionally restrict the update operation to files at or within
+the specified PATHS."
+  (with-temp-buffer
+    (unless (zerop (vc-got--call "update" "-b" branch "--" paths))
+      (error "[vc-got] can't update to branch %s: %s"
+             branch
+             (buffer-string)))))
+
 (defun vc-got--diff (&rest args)
   "Call got diff with ARGS.  The result will be stored in the current buffer."
   (let (process-file-side-effects)
@@ -839,11 +849,7 @@ true, NAME should create a new branch otherwise it will 
pop-up a
 (defun vc-got-retrieve-tag (dir name _update)
   "Switch to the tag NAME for files at or below DIR."
   (let ((default-directory dir))
-    (with-temp-buffer
-      (unless (zerop (vc-got--call "update" "-b" name "--" dir))
-        (error "[vc-got] can't switch to tag %s: %s"
-               name
-               (buffer-string))))))
+    (vc-got--update name dir)))
 
 
 ;; Miscellaneous



reply via email to

[Prev in Thread] Current Thread [Next in Thread]