[gitg/vala] Fix parsing ref id for lightweight tag



commit 28c8348da1ecaa2b11355cdfd4f381940aab4cfd
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date:   Tue Jul 17 13:56:09 2012 +0200

    Fix parsing ref id for lightweight tag

 plugins/history/gitg-history.vala |   21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)
---
diff --git a/plugins/history/gitg-history.vala b/plugins/history/gitg-history.vala
index d77d78a..efecb23 100644
--- a/plugins/history/gitg-history.vala
+++ b/plugins/history/gitg-history.vala
@@ -130,19 +130,20 @@ namespace GitgHistory
 		{
 			Ggit.OId? id = null;
 
-			if (head != null && head.parsed_name.rtype == Gitg.RefType.TAG)
+			if (head != null)
 			{
-				// See to resolve to the commit
-				try
+				id = head.get_id();
+
+				if (head.parsed_name.rtype == Gitg.RefType.TAG)
 				{
-					var t = application.repository.lookup(head.get_id(), typeof(Ggit.Tag)) as Ggit.Tag;
+					// See to resolve to the commit
+					try
+					{
+						var t = application.repository.lookup(head.get_id(), typeof(Ggit.Tag)) as Ggit.Tag;
 
-					id = t.get_target_id();
-				} catch {}
-			}
-			else if (head != null)
-			{
-				id = head.get_id();
+						id = t.get_target_id();
+					} catch {}
+				}
 			}
 
 			if (id == null && application.repository != null)



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