+
+ string[] far = {};
+ var heads = r.list();
+ foreach(var rh in heads) {
+ if (rh.get_name().has_prefix("refs/remotes/")) {
+ continue;
+ }
+
+ var br = this.getBranch(n, rh.get_name());
+
+ GLib.debug("got heads: name=%s rev=%s localrev=%s",
+ rh.get_name(),
+ rh.get_oid().to_string(),
+ br == null ? "?": this.repo.revparse(br.get_name() ).get_id().to_string()
+ );
+ var loc_oid = this.repo.revparse(br.get_name() ).get_id();
+ size_t ahead, behind;
+ this.repo.get_ahead_behind(
+ loc_oid,
+ rh.get_oid(),
+ out ahead,
+ out behind
+ );
+
+ if (rh.get_oid().to_string() == this.repo.revparse(br.get_name() ).get_id().to_string()) {
+ continue;
+ }
+ if (behind > 0) {
+ continue;
+ }
+ far += ("+refs/heads/" + br.get_name()) + ":"+ rh.get_name();
+ }
+
+ if (far.length < 1) {
+ GLib.debug("no push required.. it's uptodate");
+ return;
+ }
+
+ /*var head = this.repo.get_head();