Commit ffdacb81 authored by Christian Hergert's avatar Christian Hergert
Browse files

vcs: add fallback branch names

parent bbd94363
......@@ -193,10 +193,17 @@ ide_directory_vcs_get_priority (IdeVcs *vcs)
return G_MAXINT;
}
static gchar *
ide_directory_vcs_get_branch_name (IdeVcs *vcs)
{
return g_strdup (_("unversioned"));
}
static void
vcs_iface_init (IdeVcsInterface *iface)
{
iface->get_working_directory = ide_directory_vcs_get_working_directory;
iface->is_ignored = ide_directory_vcs_is_ignored;
iface->get_priority = ide_directory_vcs_get_priority;
iface->get_branch_name = ide_directory_vcs_get_branch_name;
}
......@@ -362,6 +362,11 @@ ide_git_vcs_get_branch_name (IdeVcs *vcs)
ret = g_strdup (ggit_ref_get_shorthand (ref));
g_object_unref (ref);
}
else
{
/* initial commit, no branch name yet */
ret = g_strdup ("master");
}
return ret;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment