Git.vala
[gitlive] / Git.vala
index 8f41b55..dab9d5d 100644 (file)
--- a/Git.vala
+++ b/Git.vala
@@ -19,13 +19,19 @@ void main()
 
        Ggit.init();
        
+       
+       GLib.Timeout.add (1, () => {
+      GLib.debug("Meanwhile");
+      return true;
+    }, GLib.Priority.DEFAULT);
+       
        var loop = new MainLoop();
        
        var a = new GitLive.Repo("/home/alan/gitlive/gitlive");
-       
-       a.loadRemoteHeads.begin((obj,res) => {
+      GLib.debug("Starting");  
+       a.loadRemoteHeads.begin(true, (obj,res) => {
                a.loadRemoteHeads.end(res);
-               print("got results");
+                GLib.debug("got results");
                a.loadLocalBranches();
                loop.quit();
        });
@@ -303,7 +309,7 @@ namespace  GitLive {
                        ThreadFunc<bool> run = () => {
                                
                                if (!force && this.remote_heads != null) {
-                                       return;
+                                       return true;;
                                }
                                var r = this.repo.lookup_remote("origin");
                                r.connect(Ggit.Direction.FETCH, this.callbacks, null, null);
@@ -322,7 +328,12 @@ namespace  GitLive {
                                                );
                                }
                                Idle.add((owned) callback);
-                               
+                               return true;;
+                       };
+                       new Thread<bool>("thread-example", run);
+                       yield;
+                       
+
                }