-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathref.lisp
More file actions
20 lines (17 loc) · 696 Bytes
/
ref.lisp
File metadata and controls
20 lines (17 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
(in-package :fwoar.cl-git.ref)
(defclass ref ()
((%repo :initarg :repo :reader ref-repo)
(%hash :initarg :hash :reader ref-hash)))
(defclass loose-ref (ref)
((%file :initarg :file :reader loose-ref-file)))
(defmethod print-object ((obj ref) s)
(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))
"~/"))))
(defmethod fwoar.cl-git:component ((component (eql :hash)) (object ref))
(ref-hash object))