diff options
Diffstat (limited to 'cmd/gitaly-git2go')
-rw-r--r-- | cmd/gitaly-git2go/main.go | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/cmd/gitaly-git2go/main.go b/cmd/gitaly-git2go/main.go new file mode 100644 index 000000000..a11cfcad8 --- /dev/null +++ b/cmd/gitaly-git2go/main.go @@ -0,0 +1,23 @@ +package main + +import ( + "os" + + git "github.com/libgit2/git2go/v30" +) + +func main() { + repo, err := git.OpenRepository(".") + if err != nil { + os.Exit(1) + } + defer repo.Free() + + head, err := repo.Head() + if err != nil { + os.Exit(1) + } + defer head.Free() + + println(head.Target().String()) +} |