Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'bundle-uri.c')
-rw-r--r--bundle-uri.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/bundle-uri.c b/bundle-uri.c
index 372e6fac5c..c02e7f62eb 100644
--- a/bundle-uri.c
+++ b/bundle-uri.c
@@ -66,6 +66,39 @@ int for_all_bundles_in_list(struct bundle_list *list,
return 0;
}
+static int summarize_bundle(struct remote_bundle_info *info, void *data)
+{
+ FILE *fp = data;
+ fprintf(fp, "[bundle \"%s\"]\n", info->id);
+ fprintf(fp, "\turi = %s\n", info->uri);
+ return 0;
+}
+
+void print_bundle_list(FILE *fp, struct bundle_list *list)
+{
+ const char *mode;
+
+ switch (list->mode) {
+ case BUNDLE_MODE_ALL:
+ mode = "all";
+ break;
+
+ case BUNDLE_MODE_ANY:
+ mode = "any";
+ break;
+
+ case BUNDLE_MODE_NONE:
+ default:
+ mode = "<unknown>";
+ }
+
+ fprintf(fp, "[bundle]\n");
+ fprintf(fp, "\tversion = %d\n", list->version);
+ fprintf(fp, "\tmode = %s\n", mode);
+
+ for_all_bundles_in_list(list, summarize_bundle, fp);
+}
+
/**
* Given a key-value pair, update the state of the given bundle list.
* Returns 0 if the key-value pair is understood. Returns -1 if the key