From f6d6ece62ea5aed90422d1e25fbe195ed397de65 Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Wed, 20 Mar 2019 16:10:36 +0800 Subject: [PATCH] Git.vala --- Git.vala | 37 ++++++++++++++++++++----------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/Git.vala b/Git.vala index 23be9fbd..8f41b559 100644 --- a/Git.vala +++ b/Git.vala @@ -299,27 +299,30 @@ namespace GitLive { public async void loadRemoteHeads(bool force = false) { SourceFunc callback = loadRemoteHeads.callback; - - if (!force && this.remote_heads != null) { - return; - } - var r = this.repo.lookup_remote("origin"); - r.connect(Ggit.Direction.FETCH, this.callbacks, null, null); - this.remote_heads = r.list(); - foreach(var br in this.remote_heads) { - if (!br.get_name().has_prefix("refs/heads/")) { - continue; + ThreadFunc run = () => { + + if (!force && this.remote_heads != null) { + return; } + var r = this.repo.lookup_remote("origin"); + r.connect(Ggit.Direction.FETCH, this.callbacks, null, null); + this.remote_heads = r.list(); - GLib.debug("Remote: name=%s oid=%s local_oid=%s is_local=%s", - br.get_name().substring(11), - br.get_oid().to_string(), - br.get_local_oid().to_string(), - br.is_local() ? "Y" : "n" - ); + 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().substring(11), + br.get_oid().to_string(), + br.get_local_oid().to_string(), + br.is_local() ? "Y" : "n" + ); + } + Idle.add((owned) callback); + } -- 2.39.2