Skip to content

Commit

Permalink
fix: tree-entry components were broken
Browse files Browse the repository at this point in the history
  • Loading branch information
fiddlerwoaroof committed Oct 18, 2024
1 parent 7b92cd5 commit 595d4a8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion delta.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
(etypecase obj
(fwoar.cl-git:git-commit :commit)
(fwoar.cl-git:git-tree :tree)
(fwoar.cl-git:blob :blob)))
(fwoar.cl-git.blob:blob :blob)))

(defun trace-bases (pack delta)
(assert (typep delta 'delta))
Expand Down
2 changes: 1 addition & 1 deletion package.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

(defpackage :fwoar.cl-git.blob
(:use :cl :fwoar.cl-git.protocol)
(:export #:blob))
(:export #:blob #:data))

(defpackage :fwoar.cl-git.commit
(:use :cl :fwoar.cl-git.protocol)
Expand Down
19 changes: 9 additions & 10 deletions tests/git-objects.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,15 @@
(fiveam:is (equal hash (fwoar.cl-git.ref:ref-hash ref)))
(fiveam:is (equal *fake-repo* (fwoar.cl-git.ref:ref-repo ref)))
(fwoar.cl-git:extract-object ref))))
(5am:is (typep object 'fwoar.cl-git::blob))
(5am:is (typep object 'fwoar.cl-git.blob:blob))
(5am:is (equal "hello, world
"
(babel:octets-to-string
(fwoar.cl-git::data
(fwoar.cl-git:extract-object
(fwoar.cl-git.pack:packed-ref
:fwoar.cl-git.git-objects.pack
"4b5fa63702dd96796042e92787f464e28f09f17d")))
:encoding :utf-8)))))
" (babel:octets-to-string
(fwoar.cl-git.blob:data
(fwoar.cl-git:extract-object
(fwoar.cl-git.pack:packed-ref
:fwoar.cl-git.git-objects.pack
"4b5fa63702dd96796042e92787f464e28f09f17d")))
:encoding :utf-8)))))


(defparameter *fake-repo-2* :fwoar.cl-git.git-objects.pack-2)
Expand Down Expand Up @@ -290,7 +289,7 @@
(5am:is
(serapeum:vector=
expectations
(fwoar.cl-git::data
(fwoar.cl-git.blob:data
(fwoar.cl-git:extract-object
(fwoar.cl-git.pack:packed-ref :fwoar.cl-git.git-objects.pack-2 ref))))))))

Expand Down
8 changes: 8 additions & 0 deletions tree.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,11 @@
(defmethod component ((component (eql :ref)) (object tree-entry))
(ref (repository object)
(hash object)))
(defmethod component ((component (eql :data)) (object tree-entry))
(component component
(ref (repository object)
(hash object))))
(defmethod component ((component string) (object tree-entry))
(component component
(ref (repository object)
(hash object))))

0 comments on commit 595d4a8

Please sign in to comment.