GitRepo.vala
[gitlive] / GitRepo.vala
index 951a46f..2c406dd 100644 (file)
@@ -176,7 +176,7 @@ public class GitRepo : Object
        var r = this.git({ "remote" , "get-url" , "--push" , "origin"});
        var uri = new Soup.URI(r);      
        this.host = uri.get_host();
-
+               this.init_config();
        
        this.loadBranches();
        this.loadActiveTicket();
@@ -253,24 +253,11 @@ public class GitRepo : Object
     }
     public bool is_autopush ()
     {
-       
-       return !FileUtils.test(this.gitdir + "/.gitlive-disable-autopush" , FileTest.EXISTS);
+       return this.get_config("autopush") == "1";
     }
     public void set_autopush(bool val)
     {
-
-               var cur = this.is_autopush();
-               GLib.debug("SET auto push : %s <= %s", val ? "ON" : "OFF",  cur  ? "ON" : "OFF");
-               if (cur == val) {
-                       return; // no change..
-               }
-               if (!val) {
-                       FileUtils.set_contents(this.gitdir + "/.gitlive-disable-autopush" , "");
-               } else {
-                       // it exists...
-                       FileUtils.remove(this.gitdir + "/.gitlive-disable-autopush" ); 
-               }
-    
+               this.set_config("autopush", val ? "1" : "0");
     }