[libgit2-glib/wip/development: 3/4] Fix ggit_repository_discover



commit da3ca173bc6ae0be2935e83244711cfa7fcb4d88
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Sat Apr 26 21:20:08 2014 +0200

    Fix ggit_repository_discover

 libgit2-glib/ggit-repository.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/libgit2-glib/ggit-repository.c b/libgit2-glib/ggit-repository.c
index 392f4d2..b71f107 100644
--- a/libgit2-glib/ggit-repository.c
+++ b/libgit2-glib/ggit-repository.c
@@ -790,10 +790,10 @@ GFile *
 ggit_repository_discover (GFile   *location,
                           GError **error)
 {
-       gchar found_path[GIT_PATH_MAX];
-       GFile *rep = NULL;
+       git_buf buf;
        gchar *path;
        gint ret;
+       GFile *rep = NULL;
 
        g_return_val_if_fail (G_IS_FILE (location), NULL);
        g_return_val_if_fail (error == NULL || *error == NULL, NULL);
@@ -802,8 +802,7 @@ ggit_repository_discover (GFile   *location,
 
        g_return_val_if_fail (path != NULL, NULL);
 
-       ret = git_repository_discover (found_path,
-                                      sizeof (found_path),
+       ret = git_repository_discover (&buf,
                                       path,
                                       0,
                                       "");
@@ -812,7 +811,8 @@ ggit_repository_discover (GFile   *location,
 
        if (ret == GIT_OK)
        {
-               rep = g_file_new_for_path (found_path);
+               rep = g_file_new_for_path (buf.ptr);
+               git_buf_free (&buf);
        }
        else
        {


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