Git.vala
authorAlan Knowles <alan@roojs.com>
Tue, 12 Mar 2019 07:47:38 +0000 (15:47 +0800)
committerAlan Knowles <alan@roojs.com>
Tue, 12 Mar 2019 07:47:38 +0000 (15:47 +0800)
Git.vala

index 0447eee..c50834d 100644 (file)
--- a/Git.vala
+++ b/Git.vala
@@ -21,10 +21,13 @@ void main()
        
        var a = new GitLive.Repo("/home/alan/git/test1-clone");
        //a.fetchAll();
-       GLib.FileUtils.set_contents("/home/alan/git/test1-clone/test1", 
-               (new GLib.DateTime.now_utc()).format("%Y-%m-%d %H:%M:%S")
-       );
-       this.repo.repo
+       var str = (new GLib.DateTime.now_utc()).format("%Y-%m-%d %H:%M:%S");
+       GLib.FileUtils.set_contents("/home/alan/git/test1-clone/test1",  str); 
+       
+       var ix = a.repo.repo.get_index();
+       
+       var sig = new Ggit.Signature.now("Alan Knowles", "alan@roojs.com");
+       a.repo.repo.create_commit("HEAD", sig, sig, null, "test commit " + str, 
        // mmh.. no git add/commit in library...
        string[] spawn_args = {"git", "commit", "-m", "test", "-a"};
        string[] spawn_env = Environ.get ();