diff options
author | Arun Isaac | 2022-07-04 23:38:50 +0530 |
---|---|---|
committer | Arun Isaac | 2022-07-04 23:41:04 +0530 |
commit | 61a592c495294c27131c06d5de42c796a06ce5ec (patch) | |
tree | 8836307c0c99334ba1ceeae0874b5c7fe8a3890a | |
parent | 9e364c12ca7f27b028e4e82ceb719d05893e2c33 (diff) | |
download | tissue-61a592c495294c27131c06d5de42c796a06ce5ec.tar.gz tissue-61a592c495294c27131c06d5de42c796a06ce5ec.tar.lz tissue-61a592c495294c27131c06d5de42c796a06ce5ec.zip |
git: Bind git_reference_symbolic_target from libgit2.
* tissue/git.scm: Import pointer->string from (system foreign).
(reference-symbolic-target): New public function.
-rw-r--r-- | tissue/git.scm | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tissue/git.scm b/tissue/git.scm index 9a95352..79d6f0b 100644 --- a/tissue/git.scm +++ b/tissue/git.scm @@ -27,10 +27,12 @@ #:use-module (ice-9 match) #:use-module (git) #:use-module (git types) - #:use-module ((system foreign) #:select (%null-pointer)) + #:use-module ((system foreign) #:select (%null-pointer + pointer->string)) #:use-module (bytestructures guile) #:use-module (tissue utils) - #:export (git-top-level + #:export (reference-symbolic-target + git-top-level %current-git-repository current-git-repository commit-date @@ -48,6 +50,12 @@ (proc (diff->pointer diff) %null-pointer) diff))) +(define reference-symbolic-target + (let ((proc (libgit2->procedure '* "git_reference_symbolic_target" '(*)))) + (lambda (reference) + (pointer->string + (proc (reference->pointer reference)))))) + (define %current-git-repository (make-parameter #f)) |