commit 7bb16f79d9239b75da67f85f08d4a6586d7ecb14 from: Omar Polo date: Sun Jan 03 09:52:52 2021 UTC implement conflicted-files commit - fab791a23c58d981375f0c0aad775fdf75b00a7c commit + 7bb16f79d9239b75da67f85f08d4a6586d7ecb14 blob - 08d53c32a9e7ac8ce871061d29a49bba935c3b78 blob + 96163a5ec42083fb78cc5ad9f1a6d45b073c243d --- vc-got.el +++ vc-got.el @@ -106,7 +106,7 @@ ;; - find-file-hook NOT IMPLEMENTED ;; - extra-menu NOT IMPLEMENTED ;; - extra-dir-menu NOT IMPLEMENTED -;; - conflicted-files NOT IMPLEMENTED +;; - conflicted-files DONE ;; - repository-url NOT IMPLEMENTED ;; TODO: use the idiom @@ -615,5 +615,20 @@ Value is returned as floating point fractional number (when (looking-at vc-got--commit-re) (match-string-no-properties 1))))) +(defun vc-got-conflicted-files (dir) + "Return the list of files with conflicts in directory DIR." + (let* ((root (vc-got-root dir)) + (default-directory root) + (process-file-side-effects)) + ;; for got it doesn't matter where we call "got status", it will + ;; always report file paths from the root of the repo. + (cl-loop with conflicts = nil + for (file . status) in (vc-got--parse-status-flag + (vc-got--status ".")) + do (when (and (eq status 'conflict) + (file-in-directory-p file dir)) + (push file conflicts)) + finally return conflicts))) + (provide 'vc-got) ;;; vc-got.el ends here