branch: externals/vc-got commit fab791a23c58d981375f0c0aad775fdf75b00a7c Author: Omar Polo <o...@omarpolo.com> Commit: Omar Polo <o...@omarpolo.com>
vc-got--call flatten and filter arg list it's handy to pass to vc-got--call lists like '("-l" 2) or nil values (maybe from (when reverse "-R")). This moves some filtering logic from vc-got--log to vc-got--call. --- vc-got.el | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/vc-got.el b/vc-got.el index a248730..08d53c3 100755 --- a/vc-got.el +++ b/vc-got.el @@ -182,7 +182,8 @@ Assume `default-directory' is inside a got worktree." (defun vc-got--call (&rest args) "Call `vc-got-program' in the `default-directory' with ARGS and put the output in the current buffer." - (apply #'process-file vc-got-program nil (current-buffer) nil args)) + (apply #'process-file vc-got-program nil (current-buffer) nil + (cl-remove-if #'null (flatten-list args)))) (defun vc-got--add (files) "Add FILES to got, passing `vc-register-switches' to the command invocation." @@ -206,16 +207,13 @@ worktree." (let (process-file-side-effects) (vc-got-with-worktree (or path default-directory) (zerop - (apply #'vc-got--call - (cl-remove-if #'null - (flatten-list - (list "log" - (when limit (list "-l" (format "%s" limit))) - (when start-commit (list "-c" start-commit)) - (when stop-commit (list "-x" stop-commit)) - (when search-pattern (list "-s" search-pattern)) - (when reverse '("-R")) - path)))))))) + (vc-got--call "log" + (when limit (list "-l" (format "%s" limit))) + (when start-commit (list "-c" start-commit)) + (when stop-commit (list "-x" stop-commit)) + (when search-pattern (list "-s" search-pattern)) + (when reverse '("-R")) + path))))) (defun vc-got--status (dir-or-file &rest files) "Return the output of ``got status''.