git.fiddlerwoaroof.com
Browse code

Merge commit 'e24e23183435b58a7d6176d848ee0f6c6b3e815a'

Ed L authored on 15/11/2020 06:15:57
Showing 3 changed files
... ...
@@ -15,8 +15,11 @@
15 15
   ())
16 16
 
17 17
 (defgeneric object-type->sym (object-type)
18
-  (:method ((o-t symbol))
19
-    o-t))
18
+  (:documentation "Canonicalizes different representations of an
19
+  object type to their symbol representation."))
20
+
21
+(defmethod object-type->sym ((o-t symbol))
22
+    o-t)
20 23
 
21 24
 (defmethod object-type->sym ((object-type number))
22 25
   (ecase object-type
... ...
@@ -1,7 +1,10 @@
1 1
 (in-package :fwoar.cl-git)
2 2
 
3
-(defvar *git-repository* nil
4
-  "The git repository path for porcelain commands to operate on.")
3
+;; TODO: Update the code so this uses an object instead of a path.
4
+(defvar *git-repository*)
5
+(setf (documentation '*git-repository* 'variable)
6
+      "The git repository path for porcelain commands to operate on.")
7
+
5 8
 (defvar *git-encoding* :utf-8
6 9
   "The encoding to use when parsing git objects")
7 10
 
... ...
@@ -7,6 +7,7 @@
7 7
                            (truename repo)))))
8 8
 
9 9
 (defun ref (repo id)
10
+  "Given a REPOsitory and a ref ID return the ref-id object."
10 11
   (let ((repo-root (root-of repo)))
11 12
     (or (alexandria:when-let ((object-file (loose-object repo id)))
12 13
           (make-instance 'loose-ref