[gitg] Allow null repository during deconstruction



commit 5513ae5b5b30c681d4ff9fab358f1c34f191571e
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Thu Aug 18 13:08:18 2016 +0200

    Allow null repository during deconstruction

 libgitg/gitg-diff-view-file-info.vala |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/libgitg/gitg-diff-view-file-info.vala b/libgitg/gitg-diff-view-file-info.vala
index 5d78dab..5fe7247 100644
--- a/libgitg/gitg-diff-view-file-info.vala
+++ b/libgitg/gitg-diff-view-file-info.vala
@@ -2,12 +2,12 @@ class Gitg.DiffViewFileInfo : Object
 {
        public Ggit.DiffDelta delta { get; construct set; }
        public bool from_workdir { get; construct set; }
-       public Repository repository { get; construct set; }
+       public Repository? repository { get; construct set; }
 
        public InputStream? new_file_input_stream { get; set; }
        public string? new_file_content_type { get; private set; }
 
-       public DiffViewFileInfo(Repository repository, Ggit.DiffDelta delta, bool from_workdir)
+       public DiffViewFileInfo(Repository? repository, Ggit.DiffDelta delta, bool from_workdir)
        {
                Object(repository: repository, delta: delta, from_workdir: from_workdir);
        }
@@ -23,7 +23,7 @@ class Gitg.DiffViewFileInfo : Object
                var id = file.get_oid();
                var path = file.get_path();
 
-               if ((id.is_zero() && !from_workdir) || (path == null && from_workdir))
+               if (repository == null || (id.is_zero() && !from_workdir) || (path == null && from_workdir))
                {
                        return;
                }


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