mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-09-13 21:21:17 +00:00
history: use is_head from GgitBranch
This commit is contained in:
parent
75ac9d9e32
commit
126dc37a44
|
@ -103,13 +103,6 @@ namespace GitgHistory
|
||||||
|
|
||||||
d_all.reverse();
|
d_all.reverse();
|
||||||
|
|
||||||
Gitg.Ref? head = null;
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
head = repo.get_head();
|
|
||||||
} catch {}
|
|
||||||
|
|
||||||
if (CommandLine.all)
|
if (CommandLine.all)
|
||||||
{
|
{
|
||||||
model.append_default(_("All commits"), null, (nc) => ref_activated(null));
|
model.append_default(_("All commits"), null, (nc) => ref_activated(null));
|
||||||
|
@ -124,31 +117,35 @@ namespace GitgHistory
|
||||||
|
|
||||||
foreach (var item in branches)
|
foreach (var item in branches)
|
||||||
{
|
{
|
||||||
var it = item;
|
var branch = item as Ggit.Branch;
|
||||||
string? icon = null;
|
string? icon = null;
|
||||||
bool isdef = false;
|
bool isdef = false;
|
||||||
|
|
||||||
if (head != null && item.get_target().equal(head.get_target()))
|
try
|
||||||
{
|
{
|
||||||
icon = "object-select-symbolic";
|
if (branch.is_head())
|
||||||
|
|
||||||
if (!CommandLine.all)
|
|
||||||
{
|
{
|
||||||
isdef = true;
|
icon = "object-select-symbolic";
|
||||||
|
|
||||||
|
if (!CommandLine.all)
|
||||||
|
{
|
||||||
|
isdef = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch {}
|
||||||
|
|
||||||
if (isdef)
|
if (isdef)
|
||||||
{
|
{
|
||||||
model.append_default(item.parsed_name.shortname,
|
model.append_default(item.parsed_name.shortname,
|
||||||
icon,
|
icon,
|
||||||
(nc) => ref_activated(it));
|
(nc) => ref_activated(item));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
model.append(item.parsed_name.shortname,
|
model.append(item.parsed_name.shortname,
|
||||||
icon,
|
icon,
|
||||||
(nc) => ref_activated(it));
|
(nc) => ref_activated(item));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue