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/gitlive/web.Texon/.git");
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 r.connect(Ggit.Direction.FETCH, null, null, null);
49 GLib.debug("Got Error Message: %s", e.message);
52 GLib.debug("getting specs '%s'", n);
54 var far = r.get_fetch_specs();
55 foreach(var rs in far) {
56 GLib.debug("got remote spec: %s", rs);
71 public class Callbacks : Ggit.RemoteCallbacks {
74 public Callbacks(Repo repo)
77 this.transfer_progress.connect(this.onTransferProgress);
80 void onTransferProgress( Ggit.TransferProgress stats)
82 GLib.debug("got progress");