branch: externals/vc-got
commit 3740d4cbbad38b9139950a0d9acb3714ca93f9d5
Author: Timo Myyrä <[email protected]>
Commit: Omar Polo <[email protected]>
fix vc-got--info command return value use
The got info command uses return value of 1 when executed for files
which are not part of got work tree which caused the emacs to show those
as errors. To avoid these errors when accessing non-registered file, tune
up the
vc-got--info function to ignore the error cases when executing the
vc-got-command and only check the command return value in
vc-got-working-revision.
---
vc-got.el | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/vc-got.el b/vc-got.el
index de6b63db81..ad9c3e8556 100755
--- a/vc-got.el
+++ b/vc-got.el
@@ -235,7 +235,7 @@ The output will be placed in the current buffer."
"Execute got info in the worktree of PATH in the current buffer."
(let (process-file-side-effects)
(vc-got-with-worktree path
- (vc-got-command t 0 path "info"))))
+ (vc-got-command t nil path "info"))))
(defun vc-got--log (&optional path limit start-commit stop-commit
search-pattern reverse include-diff)
@@ -559,7 +559,7 @@ FILES is nil, consider all the files in DIR."
(defun vc-got-working-revision (file)
"Return the last commit that touched FILE or \"0\" if it's newly added."
(with-temp-buffer
- (when (vc-got--info file)
+ (when (zerop (vc-got--info file))
(let ((pos (re-search-forward "^based on commit: " nil t)))
(if pos
(buffer-substring-no-properties pos (line-end-position))