Don't default to "master", require a branch

It doesn't really make sense to have a default branch, since we expect
people to have multiple roots.  Thus, require a branch
specification always.
This commit is contained in:
Colin Walters committed 2011-10-27 21:42:44 -04:00
1 parent d145b0426c
commit ee4edf114b
15 files changed
+105 -45

No files matched your search

+21 -15
View File
@@ -1452,15 +1452,16 @@ import_root (OstreeRepo *self,
gboolean
ostree_repo_commit (OstreeRepo *self,
const char *branch,
const char *subject,
const char *body,
GVariant *metadata,
const char *base,
GPtrArray *modified_files,
GPtrArray *removed_files,
GChecksum **out_commit,
GError **error)
const char *branch,
const char *parent,
const char *subject,
const char *body,
GVariant *metadata,
const char *base,
GPtrArray *modified_files,
GPtrArray *removed_files,
GChecksum **out_commit,
GError **error)
{
OstreeRepoPrivate *priv = GET_PRIVATE (self);
gboolean ret = FALSE;
@@ -1473,11 +1474,13 @@ ostree_repo_commit (OstreeRepo *self,
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
g_return_val_if_fail (priv->inited, FALSE);
g_return_val_if_fail (branch != NULL, FALSE);
g_return_val_if_fail (subject != NULL, FALSE);
if (branch == NULL)
branch = "master";
if (parent == NULL)
parent = branch;
if (!resolve_rev (self, branch, TRUE, &current_head, error))
if (!resolve_rev (self, parent, TRUE, &current_head, error))
goto out;
if (current_head)
@@ -1529,6 +1532,7 @@ ostree_repo_commit (OstreeRepo *self,
gboolean
ostree_repo_commit_from_filelist_fd (OstreeRepo *self,
const char *branch,
const char *parent,
const char *subject,
const char *body,
GVariant *metadata,
@@ -1553,15 +1557,17 @@ ostree_repo_commit_from_filelist_fd (OstreeRepo *self,
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
g_return_val_if_fail (priv->inited, FALSE);
g_return_val_if_fail (branch != NULL, FALSE);
g_return_val_if_fail (subject != NULL, FALSE);
if (branch == NULL)
branch = "master";
if (parent == NULL)
parent = branch;
/* We're overwriting the tree */
if (!import_root (self, base, &root, error))
goto out;
if (!resolve_rev (self, branch, TRUE, &current_head, error))
if (!resolve_rev (self, parent, TRUE, &current_head, error))
goto out;
in = (GUnixInputStream*)g_unix_input_stream_new (fd, FALSE);
+4 -2
View File
@@ -70,8 +70,9 @@ gboolean ostree_repo_load_variant (OstreeRepo *self,
GVariant **out_variant,
GError **error);
gboolean ostree_repo_commit (OstreeRepo *self,
gboolean ostree_repo_commit (OstreeRepo *self,
const char *branch,
const char *parent,
const char *subject,
const char *body,
GVariant *metadata,
@@ -81,8 +82,9 @@ gboolean ostree_repo_commit (OstreeRepo *self,
GChecksum **out_commit,
GError **error);
gboolean ostree_repo_commit_from_filelist_fd (OstreeRepo *self,
gboolean ostree_repo_commit_from_filelist_fd (OstreeRepo *self,
const char *branch,
const char *parent,
const char *subject,
const char *body,
GVariant *metadata,