[gitg/wip/commit: 19/28] Fix some reference bugs



commit bd371d67dcdb63a5392b42c466044341234cf85d
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Wed Jul 3 16:39:34 2013 +0200

    Fix some reference bugs

 libgitg/gitg-repository.vala              |   28 +++++++++++++---------------
 libgitg/gitg-stage-status-enumerator.vala |    2 +-
 2 files changed, 14 insertions(+), 16 deletions(-)
---
diff --git a/libgitg/gitg-repository.vala b/libgitg/gitg-repository.vala
index 11a1f32..3d6e2f1 100644
--- a/libgitg/gitg-repository.vala
+++ b/libgitg/gitg-repository.vala
@@ -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)
-               {
-                       ret = new Stage(this);
-                       d_stage = ret;
-               }
-               else
+               owned get
                {
-                       ret = d_stage;
-               }
+                       if (d_stage == null)
+                       {
+                               d_stage = new Stage(this);
+                       }
 
-               return (owned)ret;
+                       return d_stage;
+               }
        }
 }
 
diff --git a/libgitg/gitg-stage-status-enumerator.vala b/libgitg/gitg-stage-status-enumerator.vala
index 737a2cf..c3a7bdb 100644
--- a/libgitg/gitg-stage-status-enumerator.vala
+++ b/libgitg/gitg-stage-status-enumerator.vala
@@ -33,7 +33,7 @@ public class StageStatusFile : Object
 
        public string path
        {
-               get { return d_path; }
+               owned get { return d_path; }
        }
 
        public Ggit.StatusFlags flags


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]