2 // valac -o /tmp/ggit Git.vala --pkg libgit2-glib-1.0 --pkg libglib
7 GLib.Log.set_handler(null,
8 GLib.LogLevelFlags.LEVEL_DEBUG | GLib.LogLevelFlags.LEVEL_WARNING | GLib.LogLevelFlags.LEVEL_INFO,
20 var a = new Git.Repo("/home/alan/git/vala");
27 public class Repo : Object {
32 public Repo(string path)
34 this.repo = Ggit.Repository.open(GLib.File.new_for_path(path));
35 this.callbacks = new Callbacks(this);
40 var ar = this.repo.list_remotes();
41 foreach(var n in ar) {
42 GLib.debug("got remote '%s'", n);
43 var r = this.repo.lookup_remote(n);
44 GLib.debug("connecting '%s'", r.get_url());
47 string[] h = { "a = 1" };
48 r.connect(Ggit.Direction.FETCH, this.callbacks, null, null);
51 GLib.debug("Got Error Message: %s", e.message);
54 GLib.debug("getting specs '%s'", n);
56 var far = r.get_fetch_specs();
57 foreach(var rs in far) {
58 GLib.debug("got remote spec: %s", rs);
73 public class Callbacks : Ggit.RemoteCallbacks {
76 public Callbacks(Repo repo)
79 this.transfer_progress.connect(this.onTransferProgress);
82 void onTransferProgress( Ggit.TransferProgress stats)
84 GLib.debug("got progress");