1. evhan
  2. chicken-git


evhan  committed 10bac15

define & use shorthand for (oid->pointer (->oid <oid-ish>))

  • Participants
  • Parent commits 4a2fecd
  • Branches master

Comments (0)

Files changed (1)

File git.scm

View file
  • Ignore whitespace
         ((reference? obj) (reference-target obj))
         (else (object-id obj))))
+(define ->oid->pointer
+  (compose oid->pointer ->oid))
 (define (->reference-name obj)
   (cond ((string? obj) obj)
         ((reference? obj) (reference-name obj))
       (repository->pointer repo)
-      (oid->pointer (->oid ref))
+      (->oid->pointer ref)
     ((git) #f)))
      (if (not symbolic)
          ;; Direct references are created by OID.
-         (git-reference-create repo* name (oid->pointer (->oid target)) force)
+         (git-reference-create repo* name (->oid->pointer target) force)
          ;; Symbolic references require the target to be given by a string.
          (git-reference-symbolic-create repo* name (->reference-name target) force)))))
 (define (reference-target-set! ref target)
    (reference->pointer ref)
-   (oid->pointer (->oid target))))
+   (->oid->pointer target)))
 (define (reference-rename ref name #!optional force)
   (pointer->reference (git-reference-rename (reference->pointer ref) name force)))
     (repository->pointer repo)
-    (oid->pointer (->oid ref)))))
+    (->oid->pointer ref))))
 (define (tree-ref tree key)
      (tree-builder->pointer builder)
-     (oid->pointer (->oid obj))
+     (->oid->pointer obj)
 (define (tree-builder-write repo tb)
     (repository->pointer repo)
-    (oid->pointer (->oid ref)))))
+    (->oid->pointer ref))))
 (define (commits-fold kons knil repo #!key initial (hide '()) (sort 'none))
   (let ((walker #f))
     (repository->pointer repo)
-    (oid->pointer (->oid ref)))))
+    (->oid->pointer ref))))
 (define (create-blob* repo source)
   (let ((repo* (repository->pointer repo)))
     (repository->pointer repo)
-    (oid->pointer (->oid object)))))
+    (->oid->pointer object))))
 (define (delete-note repo #!key target reference author (committer author))
 (define (odb-has-object? odb obj)
    (odb->pointer odb)
-   (oid->pointer (->oid obj))))
+   (->oid->pointer obj)))
 (define (odb-open loc)
     (odb->pointer odb)
-    (oid->pointer (->oid obj)))))
+    (->oid->pointer obj))))
 (define (odb-write odb data #!optional (type 'blob))
   (pointer->oid (git-odb-write (odb->pointer odb) data (number-of-bytes data) type)))
     (repository->pointer repo)
-    (oid->pointer (->oid ref)))))
+    (->oid->pointer ref))))
 (define (tags-fold kons knil repo)
   (let ((state knil))