[gitg/vala] Fix check for branch being currently checked out



commit ffb202d76e0ee72430bfe76465d3c70247c9e5a5
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date:   Tue Jul 17 11:26:42 2012 +0200

    Fix check for branch being currently checked out

 plugins/history/gitg-history-navigation.vala |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/plugins/history/gitg-history-navigation.vala b/plugins/history/gitg-history-navigation.vala
index 45ca0a8..7ad5416 100644
--- a/plugins/history/gitg-history-navigation.vala
+++ b/plugins/history/gitg-history-navigation.vala
@@ -96,7 +96,12 @@ namespace GitgHistory
 
 			try
 			{
-				head = repo.get_head();
+				head = repo.lookup_reference("HEAD");
+
+				if (head.get_reference_type() != Ggit.RefType.SYMBOLIC)
+				{
+					head = null;
+				}
 			} catch {}
 
 			// Branches
@@ -106,7 +111,7 @@ namespace GitgHistory
 			{
 				var it = item;
 
-				if (head != null && item.get_id().equal(head.get_id()))
+				if (head != null && item.get_name() == head.get_target())
 				{
 					model.append_default(item.parsed_name.shortname,
 					                     "object-select-symbolic",



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