Fix parsing ref id for lightweight tag

This commit is contained in:
Jesse van den Kieboom 2012-07-17 13:56:09 +02:00
parent a46977f572
commit 28c8348da1

View file

@ -130,19 +130,20 @@ namespace GitgHistory
{
Ggit.OId? id = null;
if (head != null && head.parsed_name.rtype == Gitg.RefType.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)
if (head != null)
{
id = head.get_id();
if (head.parsed_name.rtype == Gitg.RefType.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 {}
}
}
if (id == null && application.repository != null)