revert code that did not affect memory
[gitlive] / Git2.vala
1
2
3 void main()
4 {
5          GLib.Log.set_handler(null, 
6             GLib.LogLevelFlags.LEVEL_DEBUG | GLib.LogLevelFlags.LEVEL_WARNING | GLib.LogLevelFlags.LEVEL_INFO, 
7             (dom, lvl, msg) => {
8                                         
9                                         
10                // should we debug..
11                                         
12                         
13                print("%s\n", msg);
14             }
15          ); 
16
17         Git.Threads.init();
18         var a = new GitLive.Repo("/home/alan/gitlive/web.Texon");
19         a.fetchAll();
20 }
21 namespace  GitLive {
22
23         public class Repo : Object 
24         {
25                 Git.Repository repo;
26                 
27                 public Repo (string path)
28                 {
29                         Git.Repository.open(out this.repo , path);
30                 }
31                 
32                 public void push()
33                 {
34                 string_array remotes;
35                 this.repo.get_remote_list(out remotes);
36                 
37                 foreach(var rem in remotes.strings) {
38                         Git.Remote remote;
39                         this.repo.get_remote(out remote, rem_name);
40                 
41                 
42          // get the remote.
43      git_remote* remote = NULL;
44      git_remote_lookup( &remote, repository, "origin" );
45
46      // connect to remote
47      git_remote_connect( remote, GIT_DIRECTION_PUSH )
48
49      // add a push refspec
50      git_remote_add_push( remote, "refs/heads/master:refs/heads/master" );
51
52      // configure options
53      git_push_options options;
54      git_push_init_options( &options, GIT_PUSH_OPTIONS_VERSION );
55
56      // do the push
57      git_remote_upload( remote, NULL, &options );
58
59      git_remote_free( remote );
60      return true; 
61  }