[ostree/wip/repo-file: 4/9] repo: Drop the branch parameter from ostree_repo_commit



commit 3d6188b654041b2ba08cb3ceb8d5c78e1a7a3a08
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Fri Sep 6 20:09:44 2013 -0400

    repo: Drop the branch parameter from ostree_repo_commit
    
    It's unused. Make users explicitly write a ref if they want this;
    high-level convenience API will be introduced later.

 src/libostree/ostree-repo-commit.c |   21 +++++++++------------
 src/libostree/ostree-repo.h        |    1 -
 src/ostree/ot-builtin-commit.c     |    2 +-
 3 files changed, 10 insertions(+), 14 deletions(-)
---
diff --git a/src/libostree/ostree-repo-commit.c b/src/libostree/ostree-repo-commit.c
index ca3a2df..a874af0 100644
--- a/src/libostree/ostree-repo-commit.c
+++ b/src/libostree/ostree-repo-commit.c
@@ -1190,7 +1190,6 @@ create_empty_gvariant_dict (void)
 /**
  * ostree_repo_write_commit:
  * @self: Repo
- * @branch: Name of ref
  * @parent: (allow-none): ASCII SHA256 checksum for parent, or %NULL for none
  * @subject: Subject
  * @body: Body
@@ -1204,16 +1203,15 @@ create_empty_gvariant_dict (void)
  * and @root_metadata_checksum.
  */
 gboolean
-ostree_repo_write_commit (OstreeRepo *self,
-                          const char   *branch,
-                          const char   *parent,
-                          const char   *subject,
-                          const char   *body,
-                          const char   *root_contents_checksum,
-                          const char   *root_metadata_checksum,
-                          char        **out_commit,
-                          GCancellable *cancellable,
-                          GError      **error)
+ostree_repo_write_commit (OstreeRepo    *self,
+                          const char    *parent,
+                          const char    *subject,
+                          const char    *body,
+                          const char    *root_contents_checksum,
+                          const char    *root_metadata_checksum,
+                          char         **out_commit,
+                          GCancellable  *cancellable,
+                          GError       **error)
 {
   gboolean ret = FALSE;
   gs_free char *ret_commit = NULL;
@@ -1221,7 +1219,6 @@ ostree_repo_write_commit (OstreeRepo *self,
   gs_free guchar *commit_csum = NULL;
   GDateTime *now = NULL;
 
-  g_return_val_if_fail (branch != NULL, FALSE);
   g_return_val_if_fail (subject != NULL, FALSE);
   g_return_val_if_fail (root_contents_checksum != NULL, FALSE);
   g_return_val_if_fail (root_metadata_checksum != NULL, FALSE);
diff --git a/src/libostree/ostree-repo.h b/src/libostree/ostree-repo.h
index c02ec98..ab4c4c7 100644
--- a/src/libostree/ostree-repo.h
+++ b/src/libostree/ostree-repo.h
@@ -315,7 +315,6 @@ gboolean      ostree_repo_write_mtree (OstreeRepo         *self,
                                        GError            **error);
 
 gboolean      ostree_repo_write_commit (OstreeRepo   *self,
-                                        const char   *branch,
                                         const char   *parent,
                                         const char   *subject,
                                         const char   *body,
diff --git a/src/ostree/ot-builtin-commit.c b/src/ostree/ot-builtin-commit.c
index 329cd53..fd52a3e 100644
--- a/src/ostree/ot-builtin-commit.c
+++ b/src/ostree/ot-builtin-commit.c
@@ -404,7 +404,7 @@ ostree_builtin_commit (int argc, char **argv, OstreeRepo *repo, GCancellable *ca
           goto out;
         }
 
-      if (!ostree_repo_write_commit (repo, opt_branch, parent, opt_subject, opt_body,
+      if (!ostree_repo_write_commit (repo, parent, opt_subject, opt_body,
                                      contents_checksum, root_metadata,
                                      &commit_checksum, cancellable, error))
         goto out;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]