From 512fccf8a503bd8617fe46cb62c77480b83fbaea Mon Sep 17 00:00:00 2001 From: Derrick Stolee Date: Tue, 31 Jan 2023 13:29:13 +0000 Subject: bundle-uri: parse bundle..creationToken values The previous change taught Git to parse the bundle.heuristic value, especially when its value is "creationToken". Now, teach Git to parse the bundle..creationToken values on each bundle in a bundle list. Before implementing any logic based on creationToken values for the creationToken heuristic, parse and print these values for testing purposes. Signed-off-by: Derrick Stolee Signed-off-by: Junio C Hamano --- bundle-uri.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bundle-uri.c') diff --git a/bundle-uri.c b/bundle-uri.c index 36ec542718..d4277b2e3a 100644 --- a/bundle-uri.c +++ b/bundle-uri.c @@ -83,6 +83,9 @@ 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); + + if (info->creationToken) + fprintf(fp, "\tcreationToken = %"PRIu64"\n", info->creationToken); return 0; } @@ -203,6 +206,13 @@ static int bundle_list_update(const char *key, const char *value, return 0; } + if (!strcmp(subkey, "creationtoken")) { + if (sscanf(value, "%"PRIu64, &bundle->creationToken) != 1) + warning(_("could not parse bundle list key %s with value '%s'"), + "creationToken", value); + return 0; + } + /* * At this point, we ignore any information that we don't * understand, assuming it to be hints for a heuristic the client -- cgit v1.3