Skip to content

Commit

Permalink
feat: move blob to its own file and package
Browse files Browse the repository at this point in the history
  • Loading branch information
fiddlerwoaroof committed Oct 18, 2024
1 parent 1fcaf44 commit ea732f6
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
10 changes: 10 additions & 0 deletions blob.lisp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
(in-package :fwoar.cl-git.blob)

(fwoar.cl-git.utils:defclass+ blob (fwoar.cl-git::git-object)
((%data :reader data :initarg :data)))

(defmethod -extract-object-of-type ((type (eql :blob)) s repository &key)
(blob s))

(defcomponents blob (object _)
((eql :data) (data object)))
5 changes: 0 additions & 5 deletions model.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,3 @@

(defmethod component ((component (eql :hash)) (object git-object))
(hash object))

(fwoar.cl-git.utils:defclass+ blob (fwoar.cl-git::git-object)
((%data :reader data :initarg :data)))
(defmethod -extract-object-of-type ((type (eql :blob)) s repository &key)
(blob s))
4 changes: 4 additions & 0 deletions package.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
(:use :cl)
(:export #:-extract-object-of-type #:component #:defcomponents))

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

(defpackage :fwoar.cl-git.commit
(:use :cl :fwoar.cl-git.protocol)
(:export #:git-commit #:metadata #:data))
Expand Down
2 changes: 2 additions & 0 deletions tree.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,12 @@

(defmethod component ((component (eql :entries)) (object git-tree))
(entries object))

(defmethod component ((component string) (object git-tree))
(car (remove component (entries object)
:test-not #'equal
:key 'te-name)))

(defmethod component ((component pathname) (object git-tree))
(remove-if-not (lambda (it)
(pathname-match-p it component))
Expand Down

0 comments on commit ea732f6

Please sign in to comment.