+
+
+
+
+ /*
+ public bool doMergeClose(string commit_message)
+ {
+ this.loadLocalBranches(true);
+ var oldbranch = this.head.get_name();
+ // going to asume this is merge trees..
+ string [] cmd = { "merge", "--squash", oldbranch };
+ this.git( cmd );
+ cmd = { "commit", "-a" , "-m", commit_message };
+ this.git( cmd );
+ this.push();
+ this.loadBranches(); // updates lastrev..
+
+ var notification = new Notify.Notification(
+ "Merged branch %s to %s".printf(oldbranch, master),
+ "",
+ "dialog-information"
+
+ );
+
+ notification.set_timeout(5);
+ notification.show();
+
+
+ }
+ */
+
+
+ public bool is_auto_branch ()
+ {
+ if (this.name == "gitlog") {
+ return false;
+ }
+ // check remote...
+ if (this.is_managed()) {
+ return true;
+ }
+ return false;
+
+
+ }
+
+ public async void loadRemoteHeads(bool force = false)
+ {
+ SourceFunc callback = loadRemoteHeads.callback;
+
+ ThreadFunc<bool> run = () => {
+
+ if (!force && this.remote_heads != null) {
+ return true;;
+ }
+ var r = this.repo.lookup_remote("origin");
+ r.connect(Ggit.Direction.FETCH, this.callbacks, null, null);
+ yield;
+ this.remote_heads = r.list();
+
+ foreach(var br in this.remote_heads) {
+ if (!br.get_name().has_prefix("refs/heads/")) {
+ continue;
+ }
+
+ GLib.debug("Remote: name=%s oid=%s local_oid=%s is_local=%s",
+ br.get_name(),
+ br.get_oid().to_string(),
+ br.get_local_oid().to_string(),
+ br.is_local() ? "Y" : "n"
+ );
+ }
+ Idle.add((owned) callback);
+ return true;;
+ };
+ new Thread<bool>("loadRemoteHeads-" , run);
+ yield;
+
+