[libgit2-glib] ggit_tree_get_by_file rename got by_name.



commit 924cc652a95b1403b960aa6c6ff74de1f94c1dae
Author: Ignacio Casal Quinteiro <ignacio casal nice-software com>
Date:   Sun Jan 13 21:16:53 2013 +0100

    ggit_tree_get_by_file rename got by_name.
    
    We are searching for a file name for for a path.

 libgit2-glib/ggit-tree.c |   11 ++++-------
 libgit2-glib/ggit-tree.h |    4 ++--
 2 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/libgit2-glib/ggit-tree.c b/libgit2-glib/ggit-tree.c
index 33b02f8..101ca7b 100644
--- a/libgit2-glib/ggit-tree.c
+++ b/libgit2-glib/ggit-tree.c
@@ -137,22 +137,19 @@ ggit_tree_size (GgitTree *tree)
  *
  **/
 GgitTreeEntry *
-ggit_tree_get_by_file (GgitTree *tree,
-                       GFile    *file)
+ggit_tree_get_by_name (GgitTree    *tree,
+                       const gchar *name)
 {
 	git_tree *t;
-	gchar *path;
 	GgitTreeEntry *entry = NULL;
 	const git_tree_entry *tree_entry;
 
 	g_return_val_if_fail (GGIT_IS_TREE (tree), NULL);
-	g_return_val_if_fail (G_IS_FILE (file), NULL);
+	g_return_val_if_fail (name != NULL, NULL);
 
 	t = _ggit_native_get (tree);
 
-	path = g_file_get_path (file);
-	tree_entry = git_tree_entry_byname (t, path);
-	g_free (path);
+	tree_entry = git_tree_entry_byname (t, name);
 
 	if (tree_entry != NULL)
 	{
diff --git a/libgit2-glib/ggit-tree.h b/libgit2-glib/ggit-tree.h
index 0a36b33..327755e 100644
--- a/libgit2-glib/ggit-tree.h
+++ b/libgit2-glib/ggit-tree.h
@@ -69,8 +69,8 @@ GgitTreeEntry *ggit_tree_get            (GgitTree *tree,
 
 guint          ggit_tree_size           (GgitTree *tree);
 
-GgitTreeEntry *ggit_tree_get_by_file    (GgitTree *tree,
-                                         GFile    *file);
+GgitTreeEntry *ggit_tree_get_by_name    (GgitTree    *tree,
+                                         const gchar *name);
 
 void           ggit_tree_walk           (GgitTree              *tree,
                                          GgitTreeWalkMode       mode,



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