public string gitdir;
public string git_working_dir;
public bool debug = false;
+
+ public Gee.HashMap<string,bool> ignore_files;
/**
* index of.. matching gitpath..
}
-
public static Array<GitRepo> list()
{
return list_cache;
}
-
+
FileInfo next_file;
while (true) {
public GitRepo(string path) {
// cal parent?
this.name = File.new_for_path(path).get_basename();
-
+ this.ignore_files = new Gee.HashMap<string,bool>();
this.git_working_dir = path;
this.gitdir = path + "/.git";
}
return ret;
}
+
+ 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 } );
+ this.ignore_files.set(fname, ret.length > 0);
+ return ret.length > 0;
+ } catch (SpawnError e) {
+ this.ignore_files.set(fname, false);
+ return false;
+ }
+
+ }
+
/**
* remove:
}
+
/**
* commit:
* perform a commit.
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)
public string push () throws Error, SpawnError
{
// should
- return this.git({ "push" });
+ return this.git({ "push", "origin", "HEAD" });
}
+
+
+
/**
* git:
* The meaty part.. run spawn.. with git..
{
// 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;
// may throw error...
var sp = new Spawn(cfg);
+
stdout.printf( "GOT: %s\n" , sp.output);
// parse output for some commands ?