git.fiddlerwoaroof.com
Browse code

chore: even fewer double colons

Edward Langley authored on 08/11/2023 11:31:50
Showing 2 changed files
... ...
@@ -23,7 +23,8 @@
23 23
   (:import-from :fwoar.cl-git.commit #:git-commit)
24 24
   (:import-from :fwoar.cl-git.pack #:packed-ref)
25 25
   (:export #:ensure-ref #:repository #:*want-delta* #:git-object
26
-           #:hash #:*git-encoding* #:git-commit #:ref #:component))
26
+           #:hash #:*git-encoding* #:git-commit #:ref #:component
27
+           #:*git-repository* #:git-ref #:extract-object))
27 28
 
28 29
 (defpackage :fwoar.cl-git.types
29 30
   (:use :cl )
... ...
@@ -9,17 +9,17 @@
9 9
   :in :fwoar.cl-git)
10 10
 (fiveam:in-suite :fwoar.cl-git.git-objects)
11 11
 
12
-(defclass fake-ref (fwoar.cl-git::git-ref)
12
+(defclass fake-ref (fwoar.cl-git:git-ref)
13 13
   ())
14 14
 (defun fake-ref (repo hash)
15 15
   (fwoar.lisputils:new 'fake-ref repo hash))
16 16
 
17
-(defmethod fwoar.cl-git::ref ((repo (eql *fake-repo*)) hash)
17
+(defmethod fwoar.cl-git:ref ((repo (eql *fake-repo*)) hash)
18 18
   (fake-ref repo hash))
19 19
 
20 20
 
21 21
 (fiveam:def-test basic-commit ()
22
-  (let ((fwoar.cl-git::*git-repository* *fake-repo*)
22
+  (let ((fwoar.cl-git:*git-repository* *fake-repo*)
23 23
         (object (fwoar.cl-git::extract-loose-object
24 24
                  nil
25 25
                  (asdf:system-relative-pathname
... ...
@@ -45,7 +45,7 @@
45 45
     (5am:is (equal '(("author" "L Edgley <foo@bar.com> 1605513585 -0800")
46 46
                      ("committer" "Ed L <el-github@elangley.org> 1605513585 -0800")
47 47
                      ("tree" "1da546ab4697b719efb62f11fd785d6ad3b226d2"))
48
-                   (coerce (sort (copy-seq (fwoar.cl-git.commit::metadata object))
48
+                   (coerce (sort (copy-seq (fwoar.cl-git.commit:metadata object))
49 49
                                  'string-lessp
50 50
                                  :key 'car)
51 51
                            'list)))))
... ...
@@ -69,27 +69,27 @@
69 69
                      (component :mode entry))))))
70 70
 
71 71
 (defparameter *fake-repo* :fwoar.cl-git.git-objects.pack)
72
-(defmethod fwoar.cl-git::ref ((repo (eql *fake-repo*)) hash)
72
+(defmethod fwoar.cl-git:ref ((repo (eql *fake-repo*)) hash)
73 73
   (fake-ref repo hash))
74 74
 (defmethod fwoar.cl-git::pack-files ((repo (eql *fake-repo*)))
75 75
   (list
76
-   (fwoar.cl-git.pack::pack (asdf:system-relative-pathname
77
-                             :co.fwoar.cl-git
78
-                             "tests/sample-git-objects/hello-world-pack.idx")
79
-                            (asdf:system-relative-pathname
80
-                             :co.fwoar.cl-git
81
-                             "tests/sample-git-objects/hello-world-pack.pack")
82
-                            repo)))
76
+   (fwoar.cl-git.pack:pack (asdf:system-relative-pathname
77
+                            :co.fwoar.cl-git
78
+                            "tests/sample-git-objects/hello-world-pack.idx")
79
+                           (asdf:system-relative-pathname
80
+                            :co.fwoar.cl-git
81
+                            "tests/sample-git-objects/hello-world-pack.pack")
82
+                           repo)))
83 83
 
84 84
 (fiveam:def-test pack-files-commit ()
85 85
   (let* ((hash "7d7b56a6a64e090041f55293511f48aba6699f1a")
86
-         (ref (fwoar.cl-git::packed-ref
86
+         (ref (fwoar.cl-git.pack:packed-ref
87 87
                :fwoar.cl-git.git-objects.pack
88 88
                hash))
89 89
          (object (progn (fiveam:is (not (null ref)))
90 90
                         (fiveam:is (equal hash (fwoar.cl-git::ref-hash ref)))
91 91
                         (fiveam:is (equal *fake-repo* (fwoar.cl-git::ref-repo ref)))
92
-                        (fwoar.cl-git::extract-object ref))))
92
+                        (fwoar.cl-git:extract-object ref))))
93 93
 
94 94
     (5am:is (typep object 'fwoar.cl-git:git-commit))
95 95
     (5am:is (equal "hello, git!
... ...
@@ -103,7 +103,7 @@
103 103
                    (component :committer object)))
104 104
     (5am:is (equal ()
105 105
                    (component :parents object)))
106
-    (let ((fwoar.cl-git::*git-repository* *fake-repo*))
106
+    (let ((fwoar.cl-git:*git-repository* *fake-repo*))
107 107
       (5am:is (equal "1da546ab4697b719efb62f11fd785d6ad3b226d2"
108 108
                      (fwoar.cl-git::ref-hash (component :tree object))))
109 109
       (5am:is (equal *fake-repo*
... ...
@@ -118,13 +118,13 @@
118 118
 
119 119
 (fiveam:def-test pack-files-tree ()
120 120
   (let* ((hash "1da546ab4697b719efb62f11fd785d6ad3b226d2")
121
-         (ref (fwoar.cl-git::packed-ref
121
+         (ref (fwoar.cl-git.pack:packed-ref
122 122
                :fwoar.cl-git.git-objects.pack
123 123
                hash))
124 124
          (object (progn (fiveam:is (not (null ref)))
125 125
                         (fiveam:is (equal hash (fwoar.cl-git::ref-hash ref)))
126 126
                         (fiveam:is (equal *fake-repo* (fwoar.cl-git::ref-repo ref)))
127
-                        (fwoar.cl-git::extract-object ref))))
127
+                        (fwoar.cl-git:extract-object ref))))
128 128
     (5am:is (typep object 'fwoar.cl-git::git-tree))
129 129
     (let* ((entries (fwoar.cl-git::entries object))
130 130
            (entry (progn (5am:is (= (length entries) 1))
... ...
@@ -138,20 +138,20 @@
138 138
 
139 139
 (fiveam:def-test pack-files-blob ()
140 140
   (let* ((hash "4b5fa63702dd96796042e92787f464e28f09f17d")
141
-         (ref (fwoar.cl-git::packed-ref
141
+         (ref (fwoar.cl-git.pack:packed-ref
142 142
                :fwoar.cl-git.git-objects.pack
143 143
                hash))
144 144
          (object (progn (fiveam:is (not (null ref)))
145 145
                         (fiveam:is (equal hash (fwoar.cl-git::ref-hash ref)))
146 146
                         (fiveam:is (equal *fake-repo* (fwoar.cl-git::ref-repo ref)))
147
-                        (fwoar.cl-git::extract-object ref))))
147
+                        (fwoar.cl-git:extract-object ref))))
148 148
     (5am:is (typep object 'fwoar.cl-git::blob))
149 149
     (5am:is (equal "hello, world
150 150
 "
151 151
                    (babel:octets-to-string
152 152
                     (fwoar.cl-git::data
153
-                     (fwoar.cl-git::extract-object
154
-                      (fwoar.cl-git::packed-ref
153
+                     (fwoar.cl-git:extract-object
154
+                      (fwoar.cl-git.pack:packed-ref
155 155
                        :fwoar.cl-git.git-objects.pack
156 156
                        "4b5fa63702dd96796042e92787f464e28f09f17d")))
157 157
                     :encoding :utf-8)))))
... ...
@@ -162,21 +162,21 @@
162 162
   ())
163 163
 (defun fake-ref-2 (repo hash)
164 164
   (fwoar.lisputils:new 'fake-ref-2 repo hash))
165
-(defmethod fwoar.cl-git.pack::packed-ref-pack ((ref fake-ref-2))
165
+(defmethod fwoar.cl-git.pack:packed-ref-pack ((ref fake-ref-2))
166 166
   (let* ((pack-file (asdf:system-relative-pathname
167 167
                      :co.fwoar.cl-git/tests
168 168
                      "tests/sample-git-objects/pack-a0533639fdee4493fdbfc1b701872ace63b95e5f.pack"))
169 169
          (index-file (asdf:system-relative-pathname
170 170
                       :co.fwoar.cl-git/tests
171 171
                       "tests/sample-git-objects/pack-a0533639fdee4493fdbfc1b701872ace63b95e5f.idx")))
172
-    (make-instance 'fwoar.cl-git.pack::pack
172
+    (make-instance 'fwoar.cl-git.pack:pack
173 173
                    :repository nil
174 174
                    :index index-file
175 175
                    :pack pack-file)))
176
-(defmethod fwoar.cl-git.pack::packed-ref-offset ((ref fake-ref-2))
177
-  (nth-value 1 (fwoar.cl-git.pack::find-sha-in-pack (fwoar.cl-git.pack::packed-ref-pack ref)
176
+(defmethod fwoar.cl-git.pack:packed-ref-offset ((ref fake-ref-2))
177
+  (nth-value 1 (fwoar.cl-git.pack::find-sha-in-pack (fwoar.cl-git.pack:packed-ref-pack ref)
178 178
                                                     (fwoar.cl-git::ref-hash ref))))
179
-(defmethod fwoar.cl-git::ref ((repo (eql *fake-repo-2*)) hash)
179
+(defmethod fwoar.cl-git:ref ((repo (eql *fake-repo-2*)) hash)
180 180
   (fake-ref-2 repo hash))
181 181
 (defmethod fwoar.cl-git::pack-files ((repo (eql *fake-repo-2*)))
182 182
   (list
... ...
@@ -186,7 +186,7 @@
186 186
           (index-file (asdf:system-relative-pathname
187 187
                        :co.fwoar.cl-git/tests
188 188
                        "tests/sample-git-objects/pack-a0533639fdee4493fdbfc1b701872ace63b95e5f.idx")))
189
-     (make-instance 'fwoar.cl-git.pack::pack
189
+     (make-instance 'fwoar.cl-git.pack:pack
190 190
                     :repository nil
191 191
                     :index index-file
192 192
                     :pack pack-file))))
... ...
@@ -202,8 +202,8 @@
202 202
           do (5am:is (equal base-offset
203 203
                             (second
204 204
                              (fwoar.cl-git::base
205
-                              (fwoar.cl-git::extract-object
206
-                               (fwoar.cl-git::packed-ref *fake-repo-2* ref)))))))
205
+                              (fwoar.cl-git:extract-object
206
+                               (fwoar.cl-git.pack:packed-ref *fake-repo-2* ref)))))))
207 207
     ))
208 208
 
209 209
 (fiveam:def-test test-pack-roundtrip ()
... ...
@@ -273,7 +273,7 @@
273 273
                 "f03a8d1b4cea085ee9555037d09bca2dbfb990cb")))
274 274
     (loop for commit in shas
275 275
           for obj = (fwoar.cl-git.pack::raw-object-for-ref
276
-                     (fwoar.cl-git::ref :fwoar.cl-git.git-objects.pack-2 commit))
276
+                     (fwoar.cl-git:ref :fwoar.cl-git.git-objects.pack-2 commit))
277 277
           do (5am:is (equal (crypto:byte-array-to-hex-string
278 278
                              (crypto:digest-sequence :sha1 obj))
279 279
                             commit)))))
... ...
@@ -291,8 +291,8 @@
291 291
               (serapeum:vector=
292 292
                expectations
293 293
                (fwoar.cl-git::data
294
-                (fwoar.cl-git::extract-object
295
-                 (fwoar.cl-git::packed-ref :fwoar.cl-git.git-objects.pack-2 ref))))))))
294
+                (fwoar.cl-git:extract-object
295
+                 (fwoar.cl-git.pack:packed-ref :fwoar.cl-git.git-objects.pack-2 ref))))))))
296 296
 
297 297
     (test-ref "87c2b9b2dfaa1fbf66b3fe88d3a925593886b159")
298 298