Browse code
Twiddle stuff
Ed Langley authored on 12/07/2019 09:35:16
Showing 2 changed files
Showing 2 changed files
... | ... |
@@ -127,13 +127,13 @@ |
127 | 127 |
(defun object (repo id) |
128 | 128 |
(let ((repo-root (typecase repo |
129 | 129 |
(repository (root repo)) |
130 |
- (string (namestring |
|
131 |
- (truename repo)))))) |
|
130 |
+ ((or pathname string) (namestring |
|
131 |
+ (truename repo)))))) |
|
132 | 132 |
(or (alexandria:when-let ((object-file (loose-object repo id))) |
133 | 133 |
(make-instance 'loose-object :repo repo-root :hash id :file object-file)) |
134 |
- (multiple-value-bind (pack offset) (find-object-in-pack-files repo id) |
|
134 |
+ (multiple-value-bind (pack offset) (find-object-in-pack-files repo-root id) |
|
135 | 135 |
(when pack |
136 |
- (make-instance 'packed-object :repo repo-root :offset offset :pack pack)))))) |
|
136 |
+ (make-instance 'packed-object :hash id :repo repo-root :offset offset :pack pack)))))) |
|
137 | 137 |
|
138 | 138 |
(defun extract-loose-object (repo file) |
139 | 139 |
(with-open-file (s file :element-type '(unsigned-byte 8)) |
... | ... |
@@ -36,8 +36,8 @@ |
36 | 36 |
|
37 | 37 |
(defun git:show (object) |
38 | 38 |
(babel:octets-to-string |
39 |
- (coerce (extract-object (repository *git-repository*) |
|
40 |
- object) |
|
39 |
+ (coerce (extract-object-next (object (repository *git-repository*) |
|
40 |
+ object)) |
|
41 | 41 |
'(vector serapeum:octet)) |
42 | 42 |
:encoding *git-encoding*)) |
43 | 43 |
|