GitRepo.vala
[gitlive] / GitRepo.vala
index 8659ac6..93a94e2 100644 (file)
@@ -72,7 +72,7 @@ public class GitRepo : Object
                 }
                 
             } catch (Error e) {
-                print(e.message);
+                print("Error: %s\n",e.message);
                 break;
             }
          
@@ -244,7 +244,7 @@ public class GitRepo : Object
     public string pull () throws Error, SpawnError
     {
         // should probably hand error conditions better... 
-        string[] cmd = { "pull" };
+        string[] cmd = { "pull" , "--no-edit", "origin", "HEAD" };
         return this.git( cmd );
 
         
@@ -261,7 +261,7 @@ public class GitRepo : Object
     public string push () throws Error, SpawnError
     {
         // should 
-        return this.git({ "push" });
+        return this.git({ "push", "origin", "HEAD" });
         
     }
      /**
@@ -275,13 +275,12 @@ public class GitRepo : Object
     {
         // convert arguments.
         
-
         string[]  args = { "git" };
         //args +=  "--git-dir";
         //args +=  this.gitdir;
         args +=  "--no-pager";
  
-
         //if (this.gitdir != this.repopath) {
         //    args +=   "--work-tree";
          //   args += this.repopath; 
@@ -293,7 +292,7 @@ public class GitRepo : Object
         //this.lastCmd = args.join(" ");
         //if(this.debug) {
             stdout.printf( "CWD=%s\n",  this.git_working_dir ); 
-            print(  string.joinv (" ", args)); 
+            print( "cmd: %s\n", string.joinv (" ", args)); 
         //}
 
         string[]   env = {};
@@ -305,12 +304,12 @@ public class GitRepo : Object
         //}
         
 
-
         var cfg = new SpawnConfig(this.git_working_dir , args , env);
         
 
        // may throw error...
         var sp = new Spawn(cfg);
+      
 
         stdout.printf( "GOT: %s\n" , sp.output);
         // parse output for some commands ?