summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-07-04 23:39:57 +0530
committerArun Isaac2022-07-04 23:41:04 +0530
commitef7bd1fcc9b020a7e80b377d6956856427ffebba (patch)
treee1ad26439c381e98f3930dd5ef51a394d93eb6ae
parent61a592c495294c27131c06d5de42c796a06ce5ec (diff)
downloadtissue-ef7bd1fcc9b020a7e80b377d6956856427ffebba.tar.gz
tissue-ef7bd1fcc9b020a7e80b377d6956856427ffebba.tar.lz
tissue-ef7bd1fcc9b020a7e80b377d6956856427ffebba.zip
git: Bind git_reference_set_target from libgit2.
* tissue/git.scm: Import dereference-pointer and string->pointer from (system foreign). (reference-set-target!): New public function.
-rw-r--r--tissue/git.scm19
1 files changed, 17 insertions, 2 deletions
diff --git a/tissue/git.scm b/tissue/git.scm
index 79d6f0b..7f61785 100644
--- a/tissue/git.scm
+++ b/tissue/git.scm
@@ -28,10 +28,13 @@
#:use-module (git)
#:use-module (git types)
#:use-module ((system foreign) #:select (%null-pointer
- pointer->string))
+ dereference-pointer
+ pointer->string
+ string->pointer))
#:use-module (bytestructures guile)
#:use-module (tissue utils)
- #:export (reference-symbolic-target
+ #:export (reference-set-target!
+ reference-symbolic-target
git-top-level
%current-git-repository
current-git-repository
@@ -50,6 +53,18 @@
(proc (diff->pointer diff) %null-pointer)
diff)))
+(define reference-set-target!
+ (let ((proc (libgit2->procedure* "git_reference_set_target" '(* * * *))))
+ (lambda* (reference oid #:optional log-message)
+ (let ((out (make-double-pointer)))
+ (proc out
+ (reference->pointer reference)
+ (oid->pointer oid)
+ (if log-message
+ (string->pointer log-message)
+ %null-pointer))
+ (pointer->reference (dereference-pointer out))))))
+
(define reference-symbolic-target
(let ((proc (libgit2->procedure '* "git_reference_symbolic_target" '(*))))
(lambda (reference)