[libgit2-glib] Wrap a branch if the ref is branch in the lookup_reference



commit 205351c2de4aebe88d623c119f47c16d7b77594b
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Sat Sep 29 12:18:20 2012 +0200

    Wrap a branch if the ref is branch in the lookup_reference

 libgit2-glib/ggit-repository.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/libgit2-glib/ggit-repository.c b/libgit2-glib/ggit-repository.c
index c4ee28f..5de2679 100644
--- a/libgit2-glib/ggit-repository.c
+++ b/libgit2-glib/ggit-repository.c
@@ -536,7 +536,14 @@ ggit_repository_lookup_reference (GgitRepository  *repository,
 
 	if (ret == GIT_OK)
 	{
-		ref = _ggit_ref_wrap (reference);
+		if (g_str_has_prefix (name, "refs/heads/"))
+		{
+			ref = GGIT_REF (_ggit_branch_wrap (reference));
+		}
+		else
+		{
+			ref = _ggit_ref_wrap (reference);
+		}
 	}
 	else
 	{



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