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:
Jesse van den Kieboom 2008-10-04 22:32:12 +02:00
parent 0ad17e380a
commit b380c0ceed

View file

@ -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