mirror of
https://gitlab.gnome.org/GNOME/gitg
synced 2024-08-25 02:47:01 +00:00
Sort on branch name in branch drop down
Sort on branch name after sorting on branch type. Sort 'master' branch first always
This commit is contained in:
parent
0ad17e380a
commit
b380c0ceed
|
@ -412,7 +412,19 @@ create_repository(GitgWindow *window, gchar const *path)
|
|||
static int
|
||||
sort_by_ref_type(GitgRef const *a, GitgRef const *b)
|
||||
{
|
||||
return a->type - b->type;
|
||||
if (a->type == b->type)
|
||||
{
|
||||
if (g_ascii_strcasecmp(a->shortname, "master") == 0)
|
||||
return -1;
|
||||
else if (g_ascii_strcasecmp(b->shortname, "master") == 0)
|
||||
return 1;
|
||||
else
|
||||
return g_ascii_strcasecmp(a->shortname, b->shortname);
|
||||
}
|
||||
else
|
||||
{
|
||||
return a->type - b->type;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue