[ostree: 56/70] ostree-repo-pull: always initialize flags_i
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree: 56/70] ostree-repo-pull: always initialize flags_i
- Date: Fri, 15 Apr 2016 21:05:57 +0000 (UTC)
commit b69fd11487cfa23ff930da6b80b73e03b0daabe3
Author: Jonathan Lebon <jlebon redhat com>
Date: Mon Apr 11 09:27:35 2016 -0400
ostree-repo-pull: always initialize flags_i
Otherwise we get undefined behaviour if the client didn't explicitly set
any flags.
Also, add documentation for all the other options supported by
ostree_repo_pull_with_options().
Closes: #252
Approved by: cgwalters
src/libostree/ostree-repo-pull.c | 2 +-
src/libostree/ostree-repo.c | 14 ++++++++++----
2 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/src/libostree/ostree-repo-pull.c b/src/libostree/ostree-repo-pull.c
index 8eca91c..e86ede5 100644
--- a/src/libostree/ostree-repo-pull.c
+++ b/src/libostree/ostree-repo-pull.c
@@ -1908,7 +1908,7 @@ ostree_repo_pull_with_options (OstreeRepo *self,
if (options)
{
- int flags_i;
+ int flags_i = OSTREE_REPO_PULL_FLAGS_NONE;
(void) g_variant_lookup (options, "refs", "^a&s", &refs_to_fetch);
(void) g_variant_lookup (options, "flags", "i", &flags_i);
/* Reduce risk of issues if enum happens to be 64 bit for some reason */
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index 47519e6..d59c8e7 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -3999,11 +3999,17 @@ ostree_repo_pull_one_dir (OstreeRepo *self,
* Like ostree_repo_pull(), but supports an extensible set of flags.
* The following are currently defined:
*
- * * subdir (s): Pull just this subdirectory
+ * * refs (as): Array of string refs
* * flags (i): An instance of #OstreeRepoPullFlags
- * * refs: (as): Array of string refs
- * * depth: (i): How far in the history to traverse; default is 0, -1 means infinite
- * * override-commit-ids: (as): Array of specific commit IDs to fetch for refs
+ * * subdir (s): Pull just this subdirectory
+ * * override-remote-name (s): If local, add this remote to refspec
+ * * gpg-verify (b): GPG verify commits
+ * * gpg-verify-summary (b): GPG verify summary
+ * * depth (i): How far in the history to traverse; default is 0, -1 means infinite
+ * * disable-static-deltas (b): Do not use static deltas
+ * * require-static-deltas (b): Require static deltas
+ * * override-commit-ids (as): Array of specific commit IDs to fetch for refs
+ * * dry-run (b): Only print information on what will be downloaded (requires static deltas)
*/
gboolean
ostree_repo_pull_with_options (OstreeRepo *self,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]