git.fiddlerwoaroof.com
Browse code

chore: shuffle stuff around

Edward Langley authored on 08/11/2023 09:26:21
Showing 5 changed files
... ...
@@ -51,8 +51,11 @@
51 51
                #:co.fwoar.cl-git)
52 52
   :serial t
53 53
   :perform (test-op (o c)
54
-                    (unless (symbol-call :fiveam '#:run! :fwoar.cl-git)
55
-                      (error "some tests failed")))
54
+                    (handler-case
55
+                        (unless (symbol-call :fiveam '#:run! :fwoar.cl-git)
56
+                          (error "some tests failed"))
57
+                      (error (c)
58
+                        (format t ">>> ~s~%" c))))
56 59
   :components ((:module "tests"
57 60
                 :components ((:file "tests")
58 61
                              (:file "branch-resolution" :depends-on ("tests"))
... ...
@@ -41,7 +41,7 @@
41 41
 
42 42
 (defun obj-to-type (obj)
43 43
   (etypecase obj
44
-    (git-commit :commit)
44
+    (fwoar.cl-git.commit::git-commit :commit)
45 45
     (git-tree :tree)
46 46
     (blob :blob)))
47 47
 
... ...
@@ -159,3 +159,8 @@
159 159
   (hash object))
160 160
 (defmethod component ((component (eql :hash)) (object git-ref))
161 161
   (ref-hash object))
162
+
163
+(fw.lu:defclass+ blob (fwoar.cl-git::git-object)
164
+  ((%data :reader data :initarg :data)))
165
+(defmethod -extract-object-of-type ((type (eql :blob)) s repository &key)
166
+  (blob s))
... ...
@@ -3,13 +3,16 @@
3 3
   (:export))
4 4
 (in-package :fwoar.cl-git.package)
5 5
 
6
+(defpackage :fwoar.cl-git.protocol
7
+  (:use :cl)
8
+  (:export #:-extract-object-of-type #:component #:defcomponents))
9
+
6 10
 (defpackage :fwoar.cl-git.commit
7 11
   (:use :cl :fwoar.cl-git.protocol)
8 12
   (:export #:git-commit))
9 13
 
10
-
11 14
 (defpackage :fwoar.cl-git
12
-  (:use :cl )
15
+  (:use :cl :fwoar.cl-git.protocol)
13 16
   (:import-from :fwoar.cl-git.commit #:git-commit)
14 17
   (:export #:ensure-ref #:repository #:*want-delta* #:git-object
15 18
            #:hash #:*git-encoding* #:git-commit))
... ...
@@ -1,25 +1,20 @@
1
-(in-package :fwoar.cl-git)
2
-
3
-(defclass+ blob (git-object)
4
-  ((%data :reader data :initarg :data)))
1
+(in-package :fwoar.cl-git.protocol)
5 2
 
6 3
 (defgeneric -extract-object-of-type (type s repository &key  &allow-other-keys)
7 4
   (:method :around (type s repository &key hash)
8 5
     (let ((result (call-next-method)))
9 6
       (prog1 result
10
-        (when (typep result 'git-object)
11
-          (setf (hash result) hash)))))
7
+        (when (typep result 'fwoar.cl-git::git-object)
8
+          (setf (fwoar.cl-git::hash result) hash)))))
12 9
 
13
-  (:method ((type (eql :blob)) s repository &key)
14
-    (blob s))
15 10
 
16 11
   (:method ((type (eql :tag)) s repository &key)
17 12
     s))
18 13
 
19 14
 (defgeneric component (component object)
20 15
   (:argument-precedence-order object component)
21
-  (:method (component (object git-ref))
22
-    (component component (extract-object object)))
16
+  (:method (component (object fwoar.cl-git::git-ref))
17
+    (component component (fwoar.cl-git::extract-object object)))
23 18
   (:method ((component sequence) object)
24 19
     (reduce (lambda (cur next)
25 20
               (component next cur))
... ...
@@ -38,8 +33,3 @@
38 33
      ,@(loop for (component . component-body) in clauses
39 34
              collect `(defcomponent ,component
40 35
                         ,@component-body))))
41
-
42
-(defpackage :fwoar.cl-git.protocol
43
-  (:use)
44
-  (:import-from :fwoar.cl-git #:-extract-object-of-type #:component #:defcomponents)
45
-  (:export #:-extract-object-of-type #:component #:defcomponents))