Commits

evhan  committed ca630ed

simplify branch-name binding

  • Participants
  • Parent commits edf2223

Comments (0)

Files changed (1)

File git-lolevel.scm

 (define branch-create       (foreign-lambda/allocate reference git_branch_create repository nonnull-c-string commit bool))
 (define branch-move         (foreign-lambda/allocate reference git_branch_move reference nonnull-c-string bool))
 (define branch-upstream     (foreign-lambda/allocate reference git_branch_upstream reference))
+(define branch-name         (foreign-lambda/allocate (const c-string) git_branch_name reference))
 (define branch-set-upstream (foreign-lambda/retval git_branch_set_upstream reference nonnull-c-string))
 (define branch-delete       (foreign-lambda/retval git_branch_delete reference))
 (define branch-is-head      (foreign-lambda bool git_branch_is_head reference))
 
-(define (branch-name ref)
-  (let-location ((str nonnull-c-string))
-    ((foreign-lambda/retval git_branch_name (c-pointer (const c-string)) reference) (location str) ref)
-    str))
-
 (define-foreign-type branch-foreach-cb (function int ((const c-string) branch-type c-pointer)))
 (define-external (branch_foreach_cb (c-string name) (branch-type type) (c-pointer fn)) int
   ((callback-lookup fn) name type) 0)