d9c448c1 |
(in-package :fwoar.cl-git.ref)
|
a4381604 |
(defclass ref ()
|
d9c448c1 |
((%repo :initarg :repo :reader ref-repo)
(%hash :initarg :hash :reader ref-hash)))
|
a4381604 |
(defclass loose-ref (ref)
|
d9c448c1 |
((%file :initarg :file :reader loose-ref-file)))
|
a4381604 |
(defmethod print-object ((obj ref) s)
|
d9c448c1 |
(print-unreadable-object (obj s :type t :identity t)
(format s "~a of ~a"
(subseq (ref-hash obj) 0 6)
(ref-repo obj)
#+(or)
(serapeum:string-replace (namestring (user-homedir-pathname))
(root-of (ref-repo obj))
"~/"))))
|
a4381604 |
(defmethod fwoar.cl-git:component ((component (eql :hash)) (object ref))
|
d9c448c1 |
(ref-hash object))
|