mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-10-02 14:13:48 +00:00
Override storing ref specs on custom GitgRemote
This commit is contained in:
parent
eff2b28f1f
commit
4faa86f163
|
@ -134,22 +134,14 @@ class RemoteManager : Object, GitgExt.RemoteLookup
|
|||
string[] fetch_specs;
|
||||
string[] push_specs;
|
||||
|
||||
try
|
||||
{
|
||||
fetch_specs = remote.get_fetch_specs();
|
||||
} catch { break; }
|
||||
fetch_specs = remote.fetch_specs;
|
||||
push_specs = remote.push_specs;
|
||||
|
||||
try
|
||||
{
|
||||
push_specs = remote.get_push_specs();
|
||||
} catch { break; }
|
||||
|
||||
var defspec = "+refs/heads/*:refs/remotes/" + name + "/*";
|
||||
Gitg.Remote? tmp = null;
|
||||
|
||||
try
|
||||
{
|
||||
tmp = (new Ggit.Remote.anonymous(d_window.repository, url, defspec)) as Gitg.Remote;
|
||||
tmp = (new Ggit.Remote.anonymous(d_window.repository, url)) as Gitg.Remote;
|
||||
}
|
||||
catch (Error e)
|
||||
{
|
||||
|
@ -161,15 +153,8 @@ class RemoteManager : Object, GitgExt.RemoteLookup
|
|||
break;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
tmp.set_fetch_specs(fetch_specs);
|
||||
} catch { break; }
|
||||
|
||||
try
|
||||
{
|
||||
tmp.set_push_specs(push_specs);
|
||||
} catch { break; }
|
||||
tmp.fetch_specs = fetch_specs;
|
||||
tmp.push_specs = push_specs;
|
||||
|
||||
remote = tmp;
|
||||
break;
|
||||
|
|
|
@ -40,6 +40,8 @@ public class Remote : Ggit.Remote
|
|||
{
|
||||
private RemoteState d_state;
|
||||
private Error? d_authentication_error;
|
||||
private string[]? d_fetch_specs;
|
||||
private string[]? d_push_specs;
|
||||
|
||||
public Error authentication_error
|
||||
{
|
||||
|
@ -202,6 +204,41 @@ public class Remote : Ggit.Remote
|
|||
public new async void fetch(Ggit.Signature signature, string? message) throws Error
|
||||
{
|
||||
yield download_intern(signature, message);
|
||||
|
||||
public string[]? fetch_specs {
|
||||
owned get {
|
||||
if (d_fetch_specs != null) {
|
||||
return d_fetch_specs;
|
||||
}
|
||||
|
||||
try {
|
||||
return get_fetch_specs();
|
||||
} catch (Error e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
set {
|
||||
d_fetch_specs = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string[]? push_specs {
|
||||
owned get {
|
||||
if (d_push_specs != null) {
|
||||
return d_push_specs;
|
||||
}
|
||||
|
||||
try {
|
||||
return get_push_specs();
|
||||
} catch (Error e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
set {
|
||||
d_push_specs = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue