GitRepo.vala
[gitlive] / GitRepo.vala
index ab17558..69a8397 100644 (file)
@@ -35,7 +35,6 @@ public class GitRepo : Object
     
     }
     
-     
     
     public static   Array<GitRepo> list()
     {
@@ -62,7 +61,7 @@ public class GitRepo : Object
             return list_cache;
             
         }
-         
+        
         FileInfo next_file; 
         
         while (true) {
@@ -164,16 +163,26 @@ public class GitRepo : Object
         
     public bool is_ignore(string fname) throws Error, SpawnError
     {
+               if (fname == ".gitignore") {
+                       this.ignore_files.clear();
+               }
+               
+               if (this.ignore_files.has_key(fname)) {
+                       return this.ignore_files.get(fname);
+               }
+               
                try {
                        var ret = this.git( { "check-ignore" , fname } );
-                       return ret == fname;
+                       this.ignore_files.set(fname, ret.length >  0);
+                       return ret.length > 0;
                } catch (SpawnError e) {
+                       this.ignore_files.set(fname, false);
                        return false;
                }
-               
-
+                
     } 
     
+    
       /**
      * remove:
      * remove files to track.
@@ -202,6 +211,7 @@ public class GitRepo : Object
 
     }
     
+    
     /**
      * commit:
      * perform a commit.
@@ -262,8 +272,15 @@ public class GitRepo : Object
         return this.git( cmd );
 
         
-        
     }
+    
+    public delegate void PullAsyncCallback (string str)
+    async public string pull_async(PullAsyncCallback cb) {
+    
+         
+    
+    }
+    
     /**
      * push:
      * Send local changes to remote repo(s)