Function: magit-list-repos-uniquify

magit-list-repos-uniquify is a byte-compiled function defined in magit-repos.el.

Signature

(magit-list-repos-uniquify ALIST)

Source Code

;; Defined in ~/.emacs.d/elpa/magit-20260411.1452/magit-repos.el
(defun magit-list-repos-uniquify (alist)
  (let (result (dict (make-hash-table :test #'equal)))
    (dolist (a (delete-dups alist))
      (puthash (car a) (cons (cdr a) (gethash (car a) dict)) dict))
    (maphash
     (lambda (key value)
       (if (length= value 1)
           (push (cons key (car value)) result)
         (setq result
               (append
                result
                (magit-list-repos-uniquify
                 (mapcar (lambda (v)
                           (cons (concat
                                  key
                                  (or (bound-and-true-p uniquify-separator)
                                      "\\")
                                  (file-name-nondirectory
                                   (directory-file-name
                                    (substring v 0 (- (1+ (length key)))))))
                                 v))
                         value))))))
     dict)
    result))