[gitg/wip/albfan/git-config: 1/2] Rely on libgit for global config file(s)



commit 20a562a56e59b21252579e948c4ddb125c103b87
Author: Christian Stadelmann <dev genodeftest de>
Date:   Sun Jan 29 14:24:39 2017 +0100

    Rely on libgit for global config file(s)

 gitg/gitg-author-details-dialog.vala | 24 +++---------------------
 1 file changed, 3 insertions(+), 21 deletions(-)
---
diff --git a/gitg/gitg-author-details-dialog.vala b/gitg/gitg-author-details-dialog.vala
index 4b4f557e..67f68206 100644
--- a/gitg/gitg-author-details-dialog.vala
+++ b/gitg/gitg-author-details-dialog.vala
@@ -56,33 +56,15 @@ namespace Gitg
 
                public static AuthorDetailsDialog? show_global(Window window)
                {
-                       var xdg_config_path = Path.build_filename(Environment.get_user_config_dir(), "git", 
"config");
-                       var config_path = Path.build_filename(Environment.get_home_dir(), ".gitconfig");
-
-                       // If neither exists yet, create default empty one
-                       if (!FileUtils.test(xdg_config_path, FileTest.EXISTS) && !FileUtils.test(config_path, 
FileTest.EXISTS))
-                       {
-                               try
-                               {
-                                       FileUtils.set_contents(config_path, "");
-                               } catch {}
-                       }
-
-                       var global_config_file = Ggit.Config.find_global();
-
-                       if (global_config_file == null)
-                       {
-                               return null;
-                       }
-
                        Ggit.Config? global_config;
 
                        try
                        {
-                               global_config = new Ggit.Config.from_file(global_config_file);
+                               global_config = new Ggit.Config.default();
                        }
-                       catch
+                       catch (Error e)
                        {
+                               warning("Error while loading config file: %s", e.message);
                                return null;
                        }
 


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