Commit 90e9ea96 authored by Alberto Fanjul's avatar Alberto Fanjul

Polish push action

- Avoid to connect to repo, that is managed by push operation
- Add access to ssh socket for flatpak
- Reload repo after push to reflect changes
parent 33ff1868
Pipeline #82896 passed with stages
in 9 minutes and 38 seconds
......@@ -109,6 +109,7 @@ class RefActionPush : GitgExt.UIElement, GitgExt.Action, GitgExt.RefAction, Obje
try
{
yield d_remote.push(branch, null);
((Gtk.ApplicationWindow)application).activate_action("reload", null);
}
catch (Error e)
{
......
......@@ -311,14 +311,6 @@ public class Remote : Ggit.Remote
private async void push_intern(string branch, Ggit.RemoteCallbacks? callbacks) throws Error
{
bool dis = false;
if (!get_connected())
{
dis = true;
yield connect(Ggit.Direction.PUSH, callbacks);
}
state = RemoteState.TRANSFERRING;
reset_transfer_progress(false);
......@@ -326,6 +318,10 @@ public class Remote : Ggit.Remote
{
yield Async.thread(() => {
var options = new Ggit.PushOptions();
if (d_callbacks == null) {
d_callbacks = new Callbacks(this, callbacks, update_transfer_progress);
}
options.set_remote_callbacks(d_callbacks);
string [] push_refs = { "refs/heads/%s:refs/heads/%s".printf(branch, branch) };
......@@ -336,12 +332,10 @@ public class Remote : Ggit.Remote
}
catch (Error e)
{
update_state(dis);
reset_transfer_progress(true);
throw e;
}
update_state(dis);
reset_transfer_progress(true);
}
......
......@@ -14,6 +14,7 @@
"--share=network",
"--socket=x11",
"--socket=wayland",
"--socket=ssh-auth",
"--filesystem=host",
"--filesystem=xdg-run/dconf",
"--filesystem=~/.config/dconf:ro",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment