GitRepo.vala
authorAlan Knowles <alan@akbkhome.com>
Sat, 10 May 2014 13:50:40 +0000 (21:50 +0800)
committerAlan Knowles <alan@akbkhome.com>
Sat, 10 May 2014 13:50:40 +0000 (21:50 +0800)
GitRepo.vala

index 459f72b..1dd9edc 100644 (file)
@@ -185,7 +185,7 @@ public class GitRepo : Object
      *
      */
     
-    public string git(string[] args_in, string[] env = {}) throws Error, SpawnError
+    public string git(string[] args_in, ?string[] env) throws Error, SpawnError
     {
         // convert arguments.
         
@@ -195,6 +195,9 @@ public class GitRepo : Object
         args +=  this.gitdir;
         args +=  "--no-pager";
 
+        if (env == null) {
+            env = {};
+        }
 
         //if (this.gitdir != this.repopath) {
         //    args +=   "--work-tree";
@@ -209,8 +212,8 @@ public class GitRepo : Object
          
             print(  string.joinv (", ", args)); 
         }
-        
-        env +=  "HOME=" + Environment.get_home_dir() ;
+        string  home = "HOME=" + Environment.get_home_dir() ;
+        env +=  home ;
         // do not need to set gitpath..
         //if (File.exists(this.repo + '/.git/config')) {
             //env.push("GITPATH=" + this.repo );