From: Alan Knowles Date: Thu, 7 Mar 2019 09:46:34 +0000 (+0800) Subject: Git2.vala X-Git-Url: http://git.roojs.org/?p=gitlive;a=commitdiff_plain;h=e7b4c624edb2e6a58f542bc201332ed9f002c4dc Git2.vala --- diff --git a/Git2.vala b/Git2.vala index e69de29b..d9dd3584 100644 --- a/Git2.vala +++ b/Git2.vala @@ -0,0 +1,57 @@ + + +void main() +{ + GLib.Log.set_handler(null, + GLib.LogLevelFlags.LEVEL_DEBUG | GLib.LogLevelFlags.LEVEL_WARNING | GLib.LogLevelFlags.LEVEL_INFO, + (dom, lvl, msg) => { + + + // should we debug.. + + + print("%s\n", msg); + } + ); + + Git.Threads.init(); + var a = new GitLive.Repo("/home/alan/gitlive/web.Texon"); + a.fetchAll(); +} +namespace GitLive { + + public class Repo : Object + { + Git.Repository repo; + + (string path) + { + Git.Repository.open(this.repo , path); + this.callbacks = new Callbacks(this); + + + +bool push(git_repository *repository) + { + + git_repository* repository; + // get the remote. + git_remote* remote = NULL; + git_remote_lookup( &remote, repository, "origin" ); + + // connect to remote + git_remote_connect( remote, GIT_DIRECTION_PUSH ) + + // add a push refspec + git_remote_add_push( remote, "refs/heads/master:refs/heads/master" ); + + // configure options + git_push_options options; + git_push_init_options( &options, GIT_PUSH_OPTIONS_VERSION ); + + // do the push + git_remote_upload( remote, NULL, &options ); + + git_remote_free( remote ); + return true; + } \ No newline at end of file