Fix some reference bugs

This commit is contained in:
Jesse van den Kieboom 2013-07-03 16:39:34 +02:00
parent dfc12858f9
commit bd371d67dc
2 changed files with 14 additions and 16 deletions

View file

@ -23,10 +23,12 @@ namespace Gitg
public class Repository : Ggit.Repository
{
private HashTable<Ggit.OId, SList<Gitg.Ref>> d_refs;
private weak Stage ?d_stage;
private Stage ?d_stage;
public string? name {
owned get {
public string? name
{
owned get
{
var f = workdir != null ? workdir : location;
return f != null ? f.get_basename() : null;
}
@ -151,21 +153,17 @@ public class Repository : Ggit.Repository
return base.get_head() as Ref;
}
public Stage get_stage()
public Stage stage
{
Stage ret;
if (d_stage == null)
owned get
{
ret = new Stage(this);
d_stage = ret;
}
else
{
ret = d_stage;
}
if (d_stage == null)
{
d_stage = new Stage(this);
}
return (owned)ret;
return d_stage;
}
}
}

View file

@ -33,7 +33,7 @@ public class StageStatusFile : Object
public string path
{
get { return d_path; }
owned get { return d_path; }
}
public Ggit.StatusFlags flags