branch: externals/vc-got
commit 345290bf80a604ab857cfdc69abb39d97302bfdf
Author: Omar Polo <[email protected]>
Commit: Omar Polo <[email protected]>
improve vc-got–diff and vc-got-diff
got expects arguments to diff to be relative to the worktree, it won’t
work with full path (even if those full paths are valid, i.e. inside a
worktree).
With this in place, we can also adjust vc-got-diff to process all the
files, and so now also vc-root-diff (C-x v D) works as intended.
---
vc-got.el | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/vc-got.el b/vc-got.el
index 134d469..05e3c02 100644
--- a/vc-got.el
+++ b/vc-got.el
@@ -259,7 +259,8 @@ DIR-OR-FILE."
(defun vc-got--diff (&rest args)
"Call got diff with ARGS. The result will be stored in the current buffer."
- (apply #'vc-got--call "diff" args))
+ (apply #'vc-got--call "diff"
+ (mapcar #'file-relative-name args)))
;; Backend properties
@@ -458,7 +459,7 @@ LIMIT limits the number of commits, optionally starting at
START-REVISION."
(vc-got-with-worktree (car files)
(cond ((and (null rev1)
(null rev2))
- (vc-got--diff (car files)))
+ (apply #'vc-got--diff files))
(t (error "Not implemented")))))))
(provide 'vc-got)